Since interactive rebase was mentioned I'd recommend taking a look at its --autosquash flag and the --fixup flag of commit. With autosquash the interactive rebase will move fixup commits to where they belong:
git commit --fixup=<commitref>
git rebase -i --autosquash HEAD~5