QuickSnip

Tag: git

Undo a git commit while keeping your changes staged.

# Undo the last commit but keep the changes staged
git reset --soft HEAD~1

# Or undo and unstage the changes (working tree preserved)
git reset HEAD~1
Updated Jul 17, 2026