edit last 5 commit message code example Example: edit last commit message git commit --amend -m "New commit message."