Revert the revert
To be able to merge the TEST
branch you'll need to revert the revert, so that the TEST
history can be applied cleanly.
I.e. whereas originally the master branch history was:
$ git checkout master
$ git log --oneline
yyyyyyy Revert "wanted change"
xxxxxxx wanted change
....
And the TEST
branch history is:
$ git checkout TEST
$ git log --oneline
aaaaaaa Test development commits
xxxxxxx wanted change
....
What you'll need is to achieve this:
$ git checkout TEST
$ git log --oneline
aaaaaaa Test development commits
zzzzzzz Revert "Revert "wanted change"" # <-
yyyyyyy Revert "wanted change"
xxxxxxx wanted change
....
I.e. a checkout at xxxxxxx
and at zzzzzzz
would be exactly the same.
Use an intermediary branch
To do that, a relatively easy way is to use an intermediary branch:
$ git checkout master
$ git checkout -b merge-resolution
$ git revert yyyyyyy
$ git merge TEST
And then merge that branch with master:
$ git checkout master
$ git merge merge-resolution
$ git branch -d merge-resolution
This should result in a clean/consistent history in master, with the changes of TEST
cleanly applied.