how to cancel a commit that was not pushed in terminal code example Example: cancel a commit not pushed git reset --soft HEAD~