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