In short, I have merged in changes from a feature branch onto my current feature branch, and have pushed the merge remotely, creating a merge commit with the changes I merged in. Now, the problem is, I didn't need these changes. Also, these changes have broken my builds, because I will need to merge in changes from other projects on my current feature branch. I want to avoid doing this, so I want to revert the merge commit.
Two feature branches, b1 and b2.
Merged b1 into b2, creating merge commit mc1, on b2.
Want to revert mc1 on b2.
Afraid revert mc1, will affect the merge of b1 into master staging.
I am afraid because I feel like the revert, will obviously have the changes that remove the stuff I merged in from b1, which could remove those changes from master once both branches have been merged into master...
Because you haven't removed your previous branch
b1, you should be able to safely revert commits onb2without losing any changes that were present onb1.You can revert commits with:
Read more about reverting commits here.
As for conflicts with
master,masterwill only have changes that are merged in. If you merge onlyb1intomaster,masterwill have the changes fromb1. If you merge onlyb2intomaster,masterwill have the changes fromb2. If you mergeb1andb2intomaster, you may have to resolve any merge conflicts that arise, butmasterwill then contain the resolved changes fromb1andb2.