Git: Undo the last commit, nothing more
$ git reset --soft HEAD^
will undo the last commit.
The file(s) you had commited will be back in the staging cache.
Source: git’s man pages:
Undo a commit and redo
$ git commit …
$ git reset –soft HEAD^ (1)
- This is most often done when you remembered what you just committed is incomplete, or you misspelled your commit message, or both. Leaves working tree as it was before “reset”.
personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki git