Revert Git to a specific commit

Sometimes, you might want to revert to a specific commit because the commit tree looks ugly or some other reasons. To fix it, follow these steps:

  1. Create a backup branch for safety reason.
$ git checkout -b backup
  1. Reset to a specific commit
$ git reset --hard COMMIT_ID
  1. Force push to server
$ git push STREAM BRANCH -f

That should be it. However, if there is any mistake, just revert from the backup branch.