go back with one commit code example
Example 1: get back some commits git
git revert {commit_id}'
Example 2: git command change to previous comit
git reflog
git checkout HEAD@{...}
git revert {commit_id}'
git reflog
git checkout HEAD@{...}