Adding something to the last git commit

git commit --amend

One way to deal with this is to create a new commit and then merge them together with git rebase -i. That however involves multiple steps, requires editing files and so on.

A much faster way is to use the --amend option for git commit. that automatically updated the most recent commit instead of creating a new one. You will be asked to optionally update the commit message and after confirming that, the commit will be updated.

But just like git rebase -i, remember to only use this before the commit has been pushed to any remote location that might also be used by others.