2

I just realized that I left one word in the commit message of a previous commit (so I can't use git commit --amend) that makes the message mean completely the opposite of what I had intended.

The commit in question is HEAD~2 on my current branch, which is ahead of the branch base. How can I edit just the message on that commit?

4

1 回答 1

3

Use interactive rebase and mark that commit with r (reword):

git rebase -i HEAD~3

Don't use rebase if your history was already made public

于 2011-10-03T15:12:12.523 回答