git undo commit keep local changes code example Example: git undo commit keep changes #windows git reset --soft HEAD~1