How to PR and merge again after reverting PR using Github Revert Button

Aboodred1 picture Aboodred1 · Jan 9, 2015 · Viewed 32.2k times · Source

Basically I used Github revert button to revert a previous PR for a feature branch into master, then I decided to merge the same feature branch that I reverted earlier, but I was not able to do so. Steps as follow:

  1. PR to merge feature branch to master
  2. Revert PR merge from (master)
  3. Tried to create new PR to merge feature branch to master again.
  4. Got this message:

There isn't anything to compare.

master is up to date with all commits from feature-branch. Try switching the base for your comparison.

Any suggestions on how can I merge feature branch again into master

Answer

Anthony picture Anthony · Feb 13, 2015

Just revert the revert. So by clicking the revert button you will have created a new PR (your step 2). Once this is merged, you will have the option to revert this, which will create a new branch with all your changes back in. You can then pull this, make changes to it (if needed) and create a new PR. You will lose all the commit messages on Github, but all file changes will still be around. Good to refer to your original branch and reverts in the new PR.

Anything to avoid a complicated rebase or force pushing to master.