# Reset the index and working tree to the desired tree
# Ensure you have no uncommitted changes that you want to keep
git reset --hard 56e05fced
# Move the branch pointer back to the previous HEAD
git reset --soft HEAD@{1}
git commit -m "Reverting to the state of the project at f414f31"
git reset --hard 4a155e5
Will move the HEAD back to where you want to be
git revert <the_commit_hash>
git revert <commit hash>
git revert
$ git revert HEAD
git reset 'HEAD@{1}'
$ git revert [here comes the commit id]
-Note that this operation creates a new commit that reverts
all of the changes instead of removing given commit from history.
$ git log --oneline
b764644 File with three lines
7c709f0 File with two lines
9ef9173 File with one line
$ git log --oneline
9ef9173 File with one line
git checkout <commit hash>
Reset Git COmmit
git reset --hard <sha1 of desired commit>