Git 2 · Undoing changes

Undo the last commit, keep the changes

Move the branch back one commit and leave the changes staged.

git reset --soft HEAD~1

Official Git 2 documentation

More undoing changes commands

All undoing changes commands · Git 2 cheatsheet

Was this page helpful?