git rebase. Specifically:
git stashto store the changes you want to add.
git rebase -i HEAD~10(or however many commits back you want to see).
(a0865...)for edit by changing the word
pickat the start of the line into
edit. Don't delete the other lines as that would delete the commits.
git stash pop
git add <file>.
git commit --amend --no-edit.
git rebase --continuewhich will rewrite the rest of your commits against the new one.