how to undo last commit which is not pushed code example Example: cancel a commit not pushed git reset --soft HEAD~