I just guessed that you can put any commit you like in an interactive Git rebase "input file", and it works.
That was fun. Used it to replace some outdated commits that I had updated in different, newer branches.