Skip to content

Instantly share code, notes, and snippets.

@td0
Created February 21, 2016 13:03
Show Gist options
  • Save td0/ab4c22fb0cd557559d09 to your computer and use it in GitHub Desktop.
Save td0/ab4c22fb0cd557559d09 to your computer and use it in GitHub Desktop.
Undo a commit and redo
$ git commit -m "Something terribly misguided" (1)
$ git reset --soft HEAD~ (2)
<< edit files as necessary >> (3)
$ git add ... (4)
$ git commit -c ORIG_HEAD (5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment