revert a git commit before a git push code example Example: cancel a commit not pushed git reset --soft HEAD~