I switched to another branch before the conflict.
git checkout -b fixbranch
Then I cherry-picked each commit that was failing to merge, one at a time.
For each of those cherry-picked commits I manually cleaned up any conflicts.
I then had a branch that I considered the "correct" branch - but I needed to replace master with it.
I followed https://stackoverflow.com/a/2862938/6083
git merge --strategy=ours master
git checkout master
git merge fixbranch