We use long-lived branches PROD, TEST et DEV.
Next app version is developped in DEV, it is merged in TEST when ready to be tested, and merged in PROD once released.
Some commits are made directly in TEST branch (for bug correction of the version being tested) and in PROD (for maintenance bug).
These commits in PROD and TEST are always "merged down" into child branches (ie: PROD merged in TEST and DEV; TEST merged in DEV).
Once in a while, a bug correction is committed in PROD, then merged down in TEST and DEV, then pushed to origin. But then, there is some changes in the planning and the bug correction should be part of the version in TEST instead of the one in PROD.
Now here is the problem : if I revert the commit in PROD, the revert will be done also in TEST and DEV when PROD is merged down. How to proceed to remove the changes in PROD and keep it in TEST and DEV even after PROD is merged down ?
What I currently do is, from TEST:
git merge PROD --no-commit
This allow me to discard reverted changes from PROD before the merge is committed in TEST. Then do a merge from TEST to DEV with no special interventions. If the only commit to be merged from PROD is the reverted one, this result in a merge with no file ... but this seems to work nonetheless.
So I was wondering if my approach is correct or if there is better way to do this ?