As other users said in the comments, you have two options:
- Unprotect your branch, which I guess it is not an option, otherwise you would not have posted the question
git revert
the changes brought in by the merged branch
To make it simple (for now), this is probably the command you need to run:
git revert -m 2 HEAD
where HEAD
references the merge commit and -m 2
just means that you want to revert the changes introduced by the second parent. However, when reverting a merge commit, you should be aware that
Reverting a merge commit declares that you will never want the tree
changes brought in by the merge. As a result, later merges will only
bring in tree changes introduced by commits that are not ancestors of
the previously reverted merge. This may or may not be what you want.
From git revert
documentation
Basically, after you revert a merge commit, you are only undoing changes, but the history still sees the commits coming from the "reverted branch" as ancestors of the mainline. So, if in the future you want to merge that branch again, even after patching with a new commit in that same branch the bugs found, you won't see the changes brought in by commits belonging to the reverted parent of the merge commit. The solution in this case is to git revert
the reverted commit.
I know, it sounds a little complicated without some pictures, Linus Torvalds explained it a lot better than me here.