GitCommand
Undo Last Commit (Keep Changes)
Type this command
git reset --soft HEAD~1Removes the last commit but keeps its changes staged.
The Git command to undo last commit (keep changes) is git reset --soft HEAD~1.
git reset --soft HEAD~1git reset --soft HEAD~1Removes the last commit but keeps its changes staged.
Run git reset --soft HEAD~1.
Run git reset --soft HEAD~1.
Type it in the terminal or command-line interface used by Git.
Yes. The command text is the same on both platforms when the tool is installed.