# git: checkout to previous commit
git checkout HEAD~X # x number of commits to go back
# Go back one commit:
git checkout HEAD~1
git checkout <commit_id>
git checkout -b <new branch> <commit_id>
git checkout HEAD~X // x is the number of commits to go back
git reset --hard HEAD~10
To rollback 10 commits back:
$ git reset --hard <commit_id>
git checkout 307a5cd # check out the commit that you want to reset to
git checkout -b fixy # create a branch named fixy to do the work
git merge -s ours master # merge master's history without changing any files
git checkout master # switch back to master
git merge fixy # and merge in the fixed branch
git push # done, no need to force push!