I learned from this blog.
git commit --amendRebasing is the process of moving a branch to a new base commit.
git rebase -i HEAD~3The result is as follows:
pick f7f3f6d changed my name a bit
pick 310154e updated README formatting and added blame
pick a5f4a0d added cat-fileWe can see the last 3 commits. Find the commit message to modify and change pick to edit
edit f7f3f6d changed my name a bit
pick 310154e updated README formatting and added blame
pick a5f4a0d added cat-fileSave and quit. Then run commit command.
git commit --all --amendor
git commit --amendAfter committing the fixed version, do:
git rebase --continue