If you're going to revert a merge, you should be sure you understand the implication, because they aren't obvious. IF you understand the implications and still want to revert the merge, then the protected master branch is not an impediment.
The reason the protected branch doesn't matter is, a revert is just a commit whose changes (relative to its parent) happen to undo changes from one or more other commits (relative to their parents). It can be done on a branch and then merged using a PR, or whatever other process is required for introducing a commit that changes master
.
The revert itself will require special arguments, to tell git
which parent the merge is to revert to. And more importantly, once the revert is merged into master
, it will be difficult to re-merge the branch whose merge you've reverted (because git
will see it as "already merged"). Your options at that point will be to "revert the revert", or to create new commits that have the same effect as the branch (e.g. by doing a rebase -f
on it).