how to checkout to previous commit code example
Example 1: git checkout commit
git checkout <commit>
Example 2: git checkout previous commit
git reset --hard HEAD~10
To rollback 10 commits back:
Example 3: checkout master with previous commit
git checkout 307a5cd
git checkout -b fixy
git merge -s ours master
git checkout master
git merge fixy
git push
Example 4: git checkout previous commit HEAD
git checkout <commit_id>
git checkout -b <new branch> <commit_id>
git checkout HEAD~X // x is the number of commits to go back