xxxxxxxxxx
$ git log --oneline
b764644 File with three lines
7c709f0 File with two lines
9ef9173 File with one line
xxxxxxxxxx
# 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"
xxxxxxxxxx
git revert -n HEAD~0
// Reverts last commit from current branch without automatically commiting
xxxxxxxxxx
$ 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.