How To Revert A Git Pull Request

Oct 16, 2025

Oct 16, 2025

Mistakes happen, even in the most disciplined development teams. You merge a pull request, only to discover later that it introduces bugs, breaks a critical workflow, or contains changes you didn’t intend to push. This is a common scenario on a massive scale; more than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

Reverting these changes quickly and safely becomes an urgent priority, but without a clear process, recovery can feel chaotic and stressful. Getting back to a stable state shouldn’t be a guessing game. Teams often waste valuable hours trying to manually undo changes or battling conflicts, risking further disruption to code quality and delivery timelines.

An efficient revert workflow not only keeps your codebase stable but also protects team productivity and project momentum. This guide explains how to revert a Git pull request using GitHub's interface and the command line, ensuring you can quickly recover from a problematic merge.

Key Takeaways

  • git revert is the safe, standard method for undoing a pull request on a shared branch because it creates a new commit that inverses the changes without altering project history.

  • GitHub, GitLab, and Bitbucket provide a "Revert" button in their web interfaces, which automates the process of creating a new pull request or merge request with the necessary reversal commits.

  • The core difference between git revert and git reset is critical: revert is for public collaboration, while reset rewrites history and is suitable only for local, unpublished branches.

  • A successful revert requires more than a command; immediate team communication and a plan to address the root cause are essential for maintaining workflow stability.

  • Reverting a pull request preserves all commits made after the original merge, but subsequent work that depended on the reverted code may require fixes.

  • Optimizing the entire pull request lifecycle, from creation to revert, is key to long-term team productivity and can be achieved with data-driven insights from tools like Entelligence AI.

What Is A Git Pull Request

A pull request is a fundamental mechanism for proposing and reviewing changes in a Git-based workflow. It is not a core Git command but a feature provided by platforms like GitHub, GitLab, and Bitbucket.

You use a pull request to notify team members that you have completed a set of changes in a feature branch and are ready to integrate them into the main codebase, typically the main or master branch. This process initiates a discussion around the code before it becomes part of the official project history.

The pull request shows the differences between the source branch (your changes) and the target branch. Teammates can then review the code, comment on specific lines, suggest modifications, and approve the merge. Once approved, the changes are merged into the target branch.

This approach maintains code quality through peer review, encourages collaboration, and provides a clear audit trail for why changes were made.

Why Is A Git Pull Request Needed?

Pull requests are a cornerstone of modern collaborative development, moving beyond simple code merging to establish a structured process for integration. They create a formal framework for ensuring code quality and knowledge sharing.

Why Is A Git Pull request needed?

Several critical factors drive the need for a pull request process:

1. Code Review and Quality Assurance

A pull request provides a dedicated space for team members to examine code changes before they are merged. Reviewers can check for logic errors, adherence to project standards, potential bugs, and overall design. This collaborative scrutiny catches issues early, reducing the likelihood of bugs reaching the main codebase.

2. Facilitated Knowledge Sharing

When team members review pull requests, they stay informed about changes across the codebase. This process distributes knowledge about new features and bug fixes, preventing silos where only one developer understands a specific part of the application. It serves as a continuous learning tool for the entire team.

3. Continuous Integration (CI) Enforcement

Pull requests can be configured to automatically run CI pipelines. This means tests, linting, and security checks are executed on the proposed changes. The merge is typically blocked until these checks pass, enforcing a baseline of code quality and stability for every integration.

4. Documentation and Audit Trail

The discussion and comments within a pull request create a permanent record of the decision-making process. This documents the "why" behind a change, which is invaluable for future maintenance, onboarding new developers, or understanding the context of a modification.

How To Revert A Git Pull Request

Reverting a pull request (or Merge Request in GitLab) is a standard procedure for safely undoing changes. The process is similar across platforms but has specific steps for each. The core concept involves creating a new change that reverses the original merge commit.

Follow these platform-specific instructions to revert a pull request.

Reverting on GitHub

GitHub provides a straightforward "Revert" button in the user interface for this purpose, automating the creation of a new pull request with the inverse changes. Follow these steps:

  1. Locate the Pull Request: Navigate to your repository on GitHub. Click the "Pull requests" tab. Find the merged pull request you need to revert from the list and open it.

  2. Open the Revert PR: Scroll to the bottom of the pull request's conversation thread. You will find a button labeled "Revert." Clicking this button opens a new pull request window.

  3. Review and Confirm: GitHub automatically pre-populates the new pull request. The title will be "Revert [Original PR Title]", and the description will reference the original PR. The changes shown will be the exact inverse of the original merge commit.

  4. Create the Revert Pull Request: Click "Create pull request." This generates a new PR containing the revert changes. You can then follow your standard process to have it reviewed and merged. Once merged, the revert is complete.

Reverting on GitLab

In GitLab, the feature is called a "Revert" for a merge request and is accessed through the user interface to generate a new branch and merge request. The procedure is as follows:

  1. Locate the Merge Request: Go to your project in GitLab. Navigate to Merge Requests in the sidebar and find the merged merge request you wish to revert.

  2. Open the Revert Modal: On the merged MR's page, look for the options button (typically represented by three dots ...) near the top right. Select Revert from the dropdown menu.

  3. Configure the Revert: A modal window will appear. GitLab will default to creating the revert in a new branch and immediately opening a new merge request. Ensure the target branch is correct (e.g., main, master).

  4. Submit the Revert: Click Revert. GitLab will create a new branch and a new merge request containing the revert commit. You can then assign reviewers and merge this new MR to undo the changes.

Reverting on Bitbucket

Bitbucket Cloud also includes a dedicated "Revert" action for pull requests, which creates a new pull request to undo the original merge. Below are the steps:

  1. Locate the Pull Request: From your Bitbucket repository, click on Pull requests in the left-hand navigation. Find and open the merged pull request you need to revert.

  2. Initiate the Revert: On the pull request page, click the ... (More options) button on the right side of the screen. Select Revert from the menu.

  3. Review the Result: Bitbucket will process the request and present you with a new, open pull request. This new PR will contain a commit that reverses the changes from the original PR.

  4. Merge the New PR: Review the changes in the new pull request. The commit message will be automatically generated. Once you are satisfied, merge this pull request to complete the revert process.

For all platforms, if the revert operation cannot be performed automatically due to conflicts, the interface will notify you. You will then need to resolve these conflicts manually, often by checking out the generated branch, resolving the conflicts locally, and then pushing the changes back to complete the process.

Standardize Your Pull Request Process With Entelligence AI

A disorganized pull request process creates significant delays. Inconsistent review times, unclear priorities, and a lack of data on cycle times make it difficult to maintain a steady flow of quality code. These inefficiencies interrupt deep work and slow down entire teams.

Entelligence AI addresses these challenges by providing objective data on your development workflow. It tracks the entire lifecycle of your work, from code commit to pull request merge, giving you the insights needed to identify and eliminate bottlenecks.

Here’s how we help you:

  • Measure Pull Request Cycle Times: Gain clear visibility into how long pull requests spend in review, helping you set and meet realistic service level expectations.

  • Identify Review Bottlenecks: See which pull requests wait the longest for review, allowing you to adjust team priorities and balance workloads effectively.

  • Track Code Review Focus Time: Understand how much uninterrupted time is available for thorough code review, ensuring high-quality feedback.

  • Correlate Activity with Outcomes: Connect specific work patterns, like context switching, with the quality and speed of pull request merges.

With Entelligence AI, your pull request process becomes more consistent, transparent, and productive, supporting both engineering velocity and code quality.

Conclusion

Reverting a pull request is a fundamental skill for any developer using Git. Whether you use GitHub, GitLab, or Bitbucket, the process is designed to be a safe, non-destructive way to undo changes while maintaining a clear project history. Understanding these procedures ensures you can respond quickly to issues without disrupting your team's workflow.

While mastering technical operations like reverting commits is crucial, true productivity gains come from understanding and improving your overall development process. This includes the efficiency of your pull request lifecycle, from initial commit to final merge.

Entelligence AI provides the data-driven insights necessary to optimize this entire workflow. Tracking cycle times, identifying bottlenecks, and measuring focus helps you create a more predictable and efficient engineering environment.

Measure what matters to improve what matters. Sign up for your free Entelligence AI trial and start building a more productive development process today.

FAQs

Q. What is the difference between git revert and git reset for undoing a pull request?

git revert creates a new commit that inverses the changes, preserving the original merge commit in the history. This is the safe method for shared branches. git reset moves the branch pointer backwards, erasing commits from the project history.

Using git reset on a public branch can cause significant conflicts for other team members and should generally be avoided.

Q. How do I revert a pull request that has already been reverted?

Reverting a revert is functionally the same as reapplying the original changes. You can revert the revert commit itself using the same methods outlined in this article. On GitHub, find the revert pull request in the list and click the "Revert" button on it. This will create a new commit that restores the original code changes.

Q. What should I do if the 'Revert' button is missing in GitHub?

The "Revert" button may be unavailable if the pull request was not a simple merge commit, if there are merge conflicts preventing an automatic revert, or if you lack write permissions to the repository.

In this case, you must use the command line. Check out the target branch, run git revert -m 1 <merge-commit-sha>, resolve any conflicts manually, and then push the new commit.

Q. Can I revert a specific commit from a pull request instead of the entire merge?

Yes, but this requires a more manual approach. You would use git revert <specific-commit-sha> for each individual commit you wish to undo. This is more complex than reverting the entire merge and may lead to logical inconsistencies if the commits within the pull request are dependent on one another. Reverting the entire merge is usually the recommended approach.

Q. How does reverting a pull request affect subsequent commits made to the branch?

Reverting only adds a new commit that cancels out the changes from the original pull request. Any commits made after the merge will remain intact. However, if those subsequent commits built upon the code from the reverted pull request, they may now contain errors or references to missing code, requiring additional fixes.

Mistakes happen, even in the most disciplined development teams. You merge a pull request, only to discover later that it introduces bugs, breaks a critical workflow, or contains changes you didn’t intend to push. This is a common scenario on a massive scale; more than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

Reverting these changes quickly and safely becomes an urgent priority, but without a clear process, recovery can feel chaotic and stressful. Getting back to a stable state shouldn’t be a guessing game. Teams often waste valuable hours trying to manually undo changes or battling conflicts, risking further disruption to code quality and delivery timelines.

An efficient revert workflow not only keeps your codebase stable but also protects team productivity and project momentum. This guide explains how to revert a Git pull request using GitHub's interface and the command line, ensuring you can quickly recover from a problematic merge.

Key Takeaways

  • git revert is the safe, standard method for undoing a pull request on a shared branch because it creates a new commit that inverses the changes without altering project history.

  • GitHub, GitLab, and Bitbucket provide a "Revert" button in their web interfaces, which automates the process of creating a new pull request or merge request with the necessary reversal commits.

  • The core difference between git revert and git reset is critical: revert is for public collaboration, while reset rewrites history and is suitable only for local, unpublished branches.

  • A successful revert requires more than a command; immediate team communication and a plan to address the root cause are essential for maintaining workflow stability.

  • Reverting a pull request preserves all commits made after the original merge, but subsequent work that depended on the reverted code may require fixes.

  • Optimizing the entire pull request lifecycle, from creation to revert, is key to long-term team productivity and can be achieved with data-driven insights from tools like Entelligence AI.

What Is A Git Pull Request

A pull request is a fundamental mechanism for proposing and reviewing changes in a Git-based workflow. It is not a core Git command but a feature provided by platforms like GitHub, GitLab, and Bitbucket.

You use a pull request to notify team members that you have completed a set of changes in a feature branch and are ready to integrate them into the main codebase, typically the main or master branch. This process initiates a discussion around the code before it becomes part of the official project history.

The pull request shows the differences between the source branch (your changes) and the target branch. Teammates can then review the code, comment on specific lines, suggest modifications, and approve the merge. Once approved, the changes are merged into the target branch.

This approach maintains code quality through peer review, encourages collaboration, and provides a clear audit trail for why changes were made.

Why Is A Git Pull Request Needed?

Pull requests are a cornerstone of modern collaborative development, moving beyond simple code merging to establish a structured process for integration. They create a formal framework for ensuring code quality and knowledge sharing.

Why Is A Git Pull request needed?

Several critical factors drive the need for a pull request process:

1. Code Review and Quality Assurance

A pull request provides a dedicated space for team members to examine code changes before they are merged. Reviewers can check for logic errors, adherence to project standards, potential bugs, and overall design. This collaborative scrutiny catches issues early, reducing the likelihood of bugs reaching the main codebase.

2. Facilitated Knowledge Sharing

When team members review pull requests, they stay informed about changes across the codebase. This process distributes knowledge about new features and bug fixes, preventing silos where only one developer understands a specific part of the application. It serves as a continuous learning tool for the entire team.

3. Continuous Integration (CI) Enforcement

Pull requests can be configured to automatically run CI pipelines. This means tests, linting, and security checks are executed on the proposed changes. The merge is typically blocked until these checks pass, enforcing a baseline of code quality and stability for every integration.

4. Documentation and Audit Trail

The discussion and comments within a pull request create a permanent record of the decision-making process. This documents the "why" behind a change, which is invaluable for future maintenance, onboarding new developers, or understanding the context of a modification.

How To Revert A Git Pull Request

Reverting a pull request (or Merge Request in GitLab) is a standard procedure for safely undoing changes. The process is similar across platforms but has specific steps for each. The core concept involves creating a new change that reverses the original merge commit.

Follow these platform-specific instructions to revert a pull request.

Reverting on GitHub

GitHub provides a straightforward "Revert" button in the user interface for this purpose, automating the creation of a new pull request with the inverse changes. Follow these steps:

  1. Locate the Pull Request: Navigate to your repository on GitHub. Click the "Pull requests" tab. Find the merged pull request you need to revert from the list and open it.

  2. Open the Revert PR: Scroll to the bottom of the pull request's conversation thread. You will find a button labeled "Revert." Clicking this button opens a new pull request window.

  3. Review and Confirm: GitHub automatically pre-populates the new pull request. The title will be "Revert [Original PR Title]", and the description will reference the original PR. The changes shown will be the exact inverse of the original merge commit.

  4. Create the Revert Pull Request: Click "Create pull request." This generates a new PR containing the revert changes. You can then follow your standard process to have it reviewed and merged. Once merged, the revert is complete.

Reverting on GitLab

In GitLab, the feature is called a "Revert" for a merge request and is accessed through the user interface to generate a new branch and merge request. The procedure is as follows:

  1. Locate the Merge Request: Go to your project in GitLab. Navigate to Merge Requests in the sidebar and find the merged merge request you wish to revert.

  2. Open the Revert Modal: On the merged MR's page, look for the options button (typically represented by three dots ...) near the top right. Select Revert from the dropdown menu.

  3. Configure the Revert: A modal window will appear. GitLab will default to creating the revert in a new branch and immediately opening a new merge request. Ensure the target branch is correct (e.g., main, master).

  4. Submit the Revert: Click Revert. GitLab will create a new branch and a new merge request containing the revert commit. You can then assign reviewers and merge this new MR to undo the changes.

Reverting on Bitbucket

Bitbucket Cloud also includes a dedicated "Revert" action for pull requests, which creates a new pull request to undo the original merge. Below are the steps:

  1. Locate the Pull Request: From your Bitbucket repository, click on Pull requests in the left-hand navigation. Find and open the merged pull request you need to revert.

  2. Initiate the Revert: On the pull request page, click the ... (More options) button on the right side of the screen. Select Revert from the menu.

  3. Review the Result: Bitbucket will process the request and present you with a new, open pull request. This new PR will contain a commit that reverses the changes from the original PR.

  4. Merge the New PR: Review the changes in the new pull request. The commit message will be automatically generated. Once you are satisfied, merge this pull request to complete the revert process.

For all platforms, if the revert operation cannot be performed automatically due to conflicts, the interface will notify you. You will then need to resolve these conflicts manually, often by checking out the generated branch, resolving the conflicts locally, and then pushing the changes back to complete the process.

Standardize Your Pull Request Process With Entelligence AI

A disorganized pull request process creates significant delays. Inconsistent review times, unclear priorities, and a lack of data on cycle times make it difficult to maintain a steady flow of quality code. These inefficiencies interrupt deep work and slow down entire teams.

Entelligence AI addresses these challenges by providing objective data on your development workflow. It tracks the entire lifecycle of your work, from code commit to pull request merge, giving you the insights needed to identify and eliminate bottlenecks.

Here’s how we help you:

  • Measure Pull Request Cycle Times: Gain clear visibility into how long pull requests spend in review, helping you set and meet realistic service level expectations.

  • Identify Review Bottlenecks: See which pull requests wait the longest for review, allowing you to adjust team priorities and balance workloads effectively.

  • Track Code Review Focus Time: Understand how much uninterrupted time is available for thorough code review, ensuring high-quality feedback.

  • Correlate Activity with Outcomes: Connect specific work patterns, like context switching, with the quality and speed of pull request merges.

With Entelligence AI, your pull request process becomes more consistent, transparent, and productive, supporting both engineering velocity and code quality.

Conclusion

Reverting a pull request is a fundamental skill for any developer using Git. Whether you use GitHub, GitLab, or Bitbucket, the process is designed to be a safe, non-destructive way to undo changes while maintaining a clear project history. Understanding these procedures ensures you can respond quickly to issues without disrupting your team's workflow.

While mastering technical operations like reverting commits is crucial, true productivity gains come from understanding and improving your overall development process. This includes the efficiency of your pull request lifecycle, from initial commit to final merge.

Entelligence AI provides the data-driven insights necessary to optimize this entire workflow. Tracking cycle times, identifying bottlenecks, and measuring focus helps you create a more predictable and efficient engineering environment.

Measure what matters to improve what matters. Sign up for your free Entelligence AI trial and start building a more productive development process today.

FAQs

Q. What is the difference between git revert and git reset for undoing a pull request?

git revert creates a new commit that inverses the changes, preserving the original merge commit in the history. This is the safe method for shared branches. git reset moves the branch pointer backwards, erasing commits from the project history.

Using git reset on a public branch can cause significant conflicts for other team members and should generally be avoided.

Q. How do I revert a pull request that has already been reverted?

Reverting a revert is functionally the same as reapplying the original changes. You can revert the revert commit itself using the same methods outlined in this article. On GitHub, find the revert pull request in the list and click the "Revert" button on it. This will create a new commit that restores the original code changes.

Q. What should I do if the 'Revert' button is missing in GitHub?

The "Revert" button may be unavailable if the pull request was not a simple merge commit, if there are merge conflicts preventing an automatic revert, or if you lack write permissions to the repository.

In this case, you must use the command line. Check out the target branch, run git revert -m 1 <merge-commit-sha>, resolve any conflicts manually, and then push the new commit.

Q. Can I revert a specific commit from a pull request instead of the entire merge?

Yes, but this requires a more manual approach. You would use git revert <specific-commit-sha> for each individual commit you wish to undo. This is more complex than reverting the entire merge and may lead to logical inconsistencies if the commits within the pull request are dependent on one another. Reverting the entire merge is usually the recommended approach.

Q. How does reverting a pull request affect subsequent commits made to the branch?

Reverting only adds a new commit that cancels out the changes from the original pull request. Any commits made after the merge will remain intact. However, if those subsequent commits built upon the code from the reverted pull request, they may now contain errors or references to missing code, requiring additional fixes.

How To Revert A Git Pull Request

Your questions,

Your questions,

Your questions,

Decoded

Decoded

Decoded

What makes Entelligence different?

Unlike tools that just flag issues, Entelligence understands context — detecting, explaining, and fixing problems while aligning with product goals and team standards.

Does it replace human reviewers?

No. It amplifies them. Entelligence handles repetitive checks so engineers can focus on architecture, logic, and innovation.

What tools does it integrate with?

It fits right into your workflow — GitHub, GitLab, Jira, Linear, Slack, and more. No setup friction, no context switching.

How secure is my code?

Your code never leaves your environment. Entelligence uses encrypted processing and complies with top industry standards like SOC 2 and HIPAA.

Who is it built for?

Fast-growing engineering teams that want to scale quality, security, and velocity without adding more manual reviews or overhead.

What makes Entelligence different?

Unlike tools that just flag issues, Entelligence understands context — detecting, explaining, and fixing problems while aligning with product goals and team standards.

Does it replace human reviewers?

No. It amplifies them. Entelligence handles repetitive checks so engineers can focus on architecture, logic, and innovation.

What tools does it integrate with?

It fits right into your workflow — GitHub, GitLab, Jira, Linear, Slack, and more. No setup friction, no context switching.

How secure is my code?

Your code never leaves your environment. Entelligence uses encrypted processing and complies with top industry standards like SOC 2 and HIPAA.

Who is it built for?

Fast-growing engineering teams that want to scale quality, security, and velocity without adding more manual reviews or overhead.

What makes Entelligence different?
Does it replace human reviewers?
What tools does it integrate with?
How secure is my code?
Who is it built for?

Refer your manager to

hire Entelligence.

Need an AI Tech Lead? Just send our resume to your manager.