checkout previous branch code example
Example 1: git go to previous branch
git checkout -
Example 2: git checkout previous commit
git reset --hard HEAD~10
To rollback 10 commits back:
Example 3: git checkout previous commit
$ git reset --hard <commit_id>