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.
In Git, "checking out" means making a certain state your current working state: the actual files in your Working Copy will be the ones from that exact point in time. In this short article, we'll discuss how you can checkout branches and specific revisions in Git.
Before executing this command keep in mind that it will leave you in detached head status
Use git checkout <sha1>
to check out a particular commit.
Where <sha1>
is the commit unique number that you can obtain with git log
Here are some options after you are in detached head status:
git checkout <existingBranch>
and replace filesgit checkout -b <new_branch_name> <sha1>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With