I cloned a Git repository of a certain project. Can I turn the files to the initial state and when I review the files go to revision 2, 3, 4 … most recent? I’d like to have an overview of how the project was evolving.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Before executing this command, keep in mind that it will leave you in a detached head status.
Use
git checkout <sha1>to check out a particular commit.Where
<sha1>is the commit unique number (SHA-1 hash value) that you can obtain withgit log.Here are some options after you are in the detached head status:
git checkout <existingBranch>and replace filesgit checkout -b <new_branch_name> <sha1>Note: to "undo" (return from) the detached head state, simply use:
git checkout <branch>(where<branch>is e.g.master).