Amend (rare)

Amend

One of the common undos takes place when you commit too early and possibly forget to add some files, or you mess up your commit message.

If you want to redo that commit, make the additional changes you forgot, stage them, and commit again using the --amend option:

git commit --amend

Effectively, it’s as if the previous commit never happened, and it won’t show up in your repository history either!

We need to use Esc + : + "wq" (enter) to exit the message amend screen!

Last updated