Git Checkout
There is a special commit called git checkout
that allows you to do a lot of different things, like switching between commits.
The HEAD system
This is your point in time. If your head is at the master, it is usually up to date and at the current point in time. You can move the head around to different points in time.
To said simply, the HEAD is your currently selected commit.
Working with Git Checkout
You can paste a git id in to the command. You can easily find the correct id if you have added good messages.
If you go back in time to a different commit, you are not deleting any commits that follow after the one you're going to. You are just moving back to a different point in time. All changes will not be lost, they will remain where they are.
Going back to top level
When you're done with what you wanted to check out, you can easily switch back to the master branch by using the command git checkout master
.