reset a git commit before push code example
Example 1: cancel a commit not pushed
git reset --soft HEAD~
Example 2: undo last commit
git reset --hard HEAD~1
Example 3: undo commit git before push
git reset HEAD~
git reset --soft HEAD~
git reset --hard HEAD~1
git reset HEAD~