git amend with previous commit code example Example: git amend with previous commit git commit --amend -m "an updated commit message"