I work in Branch X and take in deliveries from Branch Y which is maintained by other devs. I merge Y into X but need to revert changes by some faulty commits in Y to a file 'KKK' and continue working on top of their other changes while they fix that. This causes a revert commit for file 'KKK' [which I never usually touch] by me in Branch X. This means 'KKK' is reverted to 'Version A' in my branch while work on it continues in Branch Y. (see fig.)
Down the line, when 'KKK' has become more mature at 'Version I', I make another merge of Y into X, this time expecting 'KKK' to update to 'Version I'. Instead, git automatically takes my revert commit 'Version A' and ignores 'Version I' when making the merge. The file is still at 'Version A'. Why does this happen? Is something wrong with my way of working?
I have a feeling that this is related somehow to 'fast forward merges' but I'm not sure. I have tried to visualize this here.
Thanks in advance.