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