git revert after commit code example
Example 1: revert git commit
git revert <the_commit_hash>
Example 2: how to abandon changes and go last commit
#ignore all changes, and back to last commit
git add .
git stash
git revert <the_commit_hash>
#ignore all changes, and back to last commit
git add .
git stash