To undo a pull request on GitHub, a fresh pull request is generated that includes a single reversal of the merge commit from the initially merged pull request. Having write access to the repository is a prerequisite for reverting pull requests.
This tutorial will guide you through the steps to effectively revert a merged pull request directly from the GitHub dashboard, ensuring that you can quickly rectify any issues and keep your project on track.
Advertisement
Reverting Pull Request in GitHub
- Navigate to the Merged Pull Request: Go to the pull request you want to revert on GitHub.
- Revert the Pull Request: GitHub provides a “Revert” button for merged pull requests. Clicking this button will automatically create a new pull request that reverts the changes made by the original pull request. You can then follow the standard review process for this new pull request.
- Merge the Revert Pull Request: Once the revert pull request has been reviewed and approved, merge it to apply the revert.
Important Notes
Remember, always backup or ensure you have a recovery plan before performing operations that alter the history or state of your repository, especially on shared branches or in production environments.