how to remove last local commit in git code example Example: undo local commit $ git reset --soft HEAD~1