# reset to specefic commit
git reset --hard <commit id>
# to go back one step
git reset --hard HEAD~1
# note: use --soft to keep file changes
git reset --hard HEAD~0
will go to latest commit.
git reset --hard HEAD~1
will go to last but one commit.
Note: Be careful while running this command. it can't be irreversible
git update-ref -d HEAD
# rollback to commit state
git revert --no-commit 0766c053..HEAD
git commit
git reflog //to get commitID
git reset #commitID
# This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32