How to amend latest commit whilst keeping the same commit message

Viewed 93

I have edited a file and committed a message.

git add file
git commit -m "corrected spelling mistakes"

After the commit, I've now realised there was another spelling mistake in file which I promptly correct but for the sake of tidiness I want the latest spelling mistake correction to be part of the previous commit message. Is there a command that I can use to absorb the changes I make into the last commit?

Note: I have not pushed any changes to a remote repository.

0 Answers
Related