I cloned a project from Github and now I wish to revert it to the first commit, how would I do this? Also, once I am back to the first commit, how do I go up to the second commit, and then from the second to the third and so on.
You can check out any revision by giving its SHA1 id:
A helper script called
Adapted from the answer to What is the opposite of
First, to make your life easier later on, you can setup a local alias to find the initial commit and the child of a particular commit (Note: this is not always possible because of the way a DAG works)
Then you can checkout the initial commit and step through the code by checking out each child-sha:
If you're new to git, I suggest reading an article I wrote about Stepping Through Commits which details more about each of the commands being used