Skip to content

Instantly share code, notes, and snippets.

@oviniciusfeitosa
Created September 13, 2016 17:51
Show Gist options
  • Save oviniciusfeitosa/cbb8a301193787eaaf5cdf9cd5bf6427 to your computer and use it in GitHub Desktop.
Save oviniciusfeitosa/cbb8a301193787eaaf5cdf9cd5bf6427 to your computer and use it in GitHub Desktop.
[ Git ] Undo a commit and redo
Undo a commit and redo
$ git commit -m "Something terribly misguided" (1)
$ git reset HEAD~ (2)
<< edit files as necessary >> (3)
$ git add ... (4)
$ git commit -c ORIG_HEAD (5)
Source : http://stackoverflow.com/questions/927358/how-to-undo-last-commits-in-git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment