Undo a commit and redo
-
The special reference
HEADrefers to the tip of the current branch. This is actually a reference in.git/HEAD. -
When reset, the head is moved to
.git/ORIG_HEAD. -
Commit with
-copens an editor with the previous commit message to allow editing it. You can skip this with-C.git commit -m "Something terribly misguided" git reset HEAD~ # edit files as necessary git add . git commit -c ORIG_HEAD