Undo Last Git Commit (Keep Changes)

Moves HEAD back one commit while keeping all file changes staged. --soft means the commit is undone but the working tree is untouched - opposite of --hard which discards changes.

When you need this: When you just committed but realized you need to add more files or fix the commit message.

Command


        
2 views 0 copies
Log in to rate
Log in to save

Free account — save snippets into your own collections.