Inspect history, see that mistake was made 1 commit ago
git log
git rebase -i HEAD~2
edit e794bf2 Add Hello world pick 77c37d2 Further work on Hello world
stage modified file.txt and amend to commit
git add file.txt git commit --amend
This causes merge conflict in file.txt, should be avoidable?
git rebase --continue
Hello world Hello world is an excellent program.
git add file.txt git rebase --continue
git verify
Inspect history, see that mistake was made 1 commit ago
Interactive rebase to edit last 2 commits This will open rebase editor, change first line to below Fix typo in file.txtstage modified file.txt and amend to commit
In the editor fix commit message (again?)This causes merge conflict in file.txt, should be avoidable?
Edit file.txt to remove conflict markers, make it as below Again, stage file.txt and continue, just exit the editor, no changes needed on the last commit. You can inspect with git log, but that's it