git go back to previos commit version log code example
Example 1: revert git commit
git revert <the_commit_hash>
Example 2: git command change to previous comit
git checkout <commit_id>
git checkout -b <new branch> <commit_id>
git checkout HEAD~X // x is the number of commits t go back