How to add staged changes to your previous commit in Git?

To add staged changes to the previous commit, use the following command:

git commit --amend

If you don't want to modify the commit message, you can instruct git to reuse that commit message:

git commit --amend -C HEAD

Originally Posted On: Github (k88hudson)