-1

We have two branches called main and dev. Developers worked on the dev branch and they committed and pushed few changes to the dev. We are following PR process (Pull request) to merge the changes to the main branch. (we are using Azure Repos)

Pull request approved but later identified these changes no longer required so we used revert option to revert the changes. But later point of time if I want to merge the changes to the main is not working. Changes not showing in a new pull request to merge these changes.

Is there any way to overcome this issue

enter image description here

  • The new pr doesn’t include the changes because they are already in both branches. A revert is “just” another commit, so, you just need to revert the revert to reapply those changes. Therefore: Does this answer your question? [How to use Git Revert](https://stackoverflow.com/questions/19032296/how-to-use-git-revert) – AD7six Sep 11 '22 at 10:35

1 Answers1

0

If you're trying fixup a branch to be merged in after a previous merge of it was reverted, simply using git revert on the merge commit is not enough. You actually need to revert the revert commit that undid the merge, as described here. Revert does not act as an undo for the history, only for the data. Hence, when you call git revert on a merge, that merge is still present in the history, even if the changes it introduced were reverted. So when you try to merge the fixed branch again, git will still see the previous merge occurred and hence not merge commits included in the original merge.

ElderFuthark
  • 496
  • 2
  • 11
  • An example would go a long way to clarifying this answer, "You need to revert the revert" is all the reader needs to understand here :). – AD7six Sep 12 '22 at 14:58