2020-02-19-UndoLastCommit
$ 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)
Your last commit
Sencond step above, illustrates how to move your git-head one commit back.
Make changes - Remove changes which you didn't want.
Add your new changes.
Commit those changes ✅👍 - You're all set.
Last updated
Was this helpful?