git remove local commit not pushed keep changes code example Example: cancel a commit not pushed git reset --soft HEAD~