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