Git – Update Last Commit With Changes You Forgot to Make

If you just did a commit and you then realized that something is wrong and you need to amend that commit to include your change, then you do:

 
$ git add .
$ git commit --amend

that’s all. Git will pick up all your changes that you want to the commit and add them to the last commit.