How To Delete Pull Request In Azure DevOps

In this article, I will walk you through exactly how to remove a pull request from Azure DevOps, explain the critical difference between “Abandoning” and “Deleting,” and show you the professional way to clean up your repository history.

How To Delete Pull Request In Azure DevOps

The Hard Truth: You Cannot “Delete” a PR

Before we dive into the tutorial, we need to clear up a major misconception. In Azure DevOps, you cannot permanently delete a pull request record from the database.

Unlike a local Git branch which you can delete --force and wipe from existence, Azure DevOps is an enterprise tool designed for strict auditing. If you could secretly delete a PR, you could hide code reviews or compliance checks. Therefore, Microsoft does not provide a “Delete” button.

Instead, the mechanism we use is Abandon.

When you abandon a PR:

  • It is removed from the “Active” list.
  • The code is not merged.
  • It is essentially archived as “Cancelled.”
  • It will still exist in the “Abandoned” tab for historical reference.

If your goal is to get it off your team’s dashboard and stop the build policies from running, Abandoning is the solution you are looking for.

How to Delete (Abandon) a Pull Request: Step-by-Step

If you have a PR that was opened by mistake or is no longer relevant, here is how you remove it from your active queue.

Step 1: Navigate to Your Pull Requests

  1. Log in to your Azure DevOps organization (https://dev.azure.com/YourOrg).
  2. Open your Project.
  3. On the left-hand sidebar, hover over Repos and click on Pull requests as shown in the screenshot below.
abandon pull request azure devops

Step 2: Locate the Target PR

By default, you might only see PRs assigned to you.

  • Click on the Mine tab to see PRs you created.
  • Click on the Active tab to see all open PRs in the repository.
  • Click the title of the PR you want to remove to open its details page.
delete pull request azure devops

Step 3: The Abandon Action

  1. Look at the top-right corner of the PR screen. You will see a Complete button (usually blue). Do not click this.
  2. Next to the Complete button, there is a three-dot menu icon ( … ) or sometimes a button labeled “Abandon” depending on your version.
  3. Click the menu and select Abandon.

Step 4: Confirm the Action

A dialog box will appear asking for a reason.

  • Pro Tip: Always type a reason (e.g., Targeted wrong branch or Duplicate of PR #104). This helps your future self when you are auditing history six months from now.
  • Click Abandon to confirm.

Once you do this, the PR status changes to Abandoned. It will disappear from the default “Active” lists, and no further build validations will run against it.

How to Delete the Source Branch (The Cleanup)

Abandoning the PR closes the request, but it does not delete the branch containing the code. If you want to truly clean up the mess, you need to delete the source branch as well.

This is the step most developers forget, leaving their repo cluttered with stale branches like feature/login-fix-v2-final-final.

  1. Go back to Repos > Branches.
  2. Find the branch you used for the PR (e.g., user/jdoe/fix-typo).
  3. Hover over the row for that branch.
  4. Click the trash can icon (Delete branch).

Note: If you set a “Branch Policy” that prevents deletion, you might need to ask your Project Administrator to remove it for you.

Comparison: Active vs. Abandoned vs. Completed

To help you visualize the lifecycle, here is how the statuses compare:

FeatureActive PRAbandoned PRCompleted PR
VisibilityDefault view (Active tab)Hidden in “Abandoned” tabHidden in “Completed” tab
Code StatusPending MergeNot MergedMerged
Audit HistoryFully VisibleRetained in HistoryRetained in History
Can be Reactivated?N/AYesNo (must revert)

Permissions: Who Can Abandon a PR?

Not everyone can delete (abandon) every PR. Azure DevOps has a specific permission hierarchy.

  • The Creator: If you created the PR, you can always abandon it.
  • Reviewers: Generally, reviewers cannot abandon a PR unless they have higher permissions.
  • Project Admins: Administrators with “Edit policies” or “Manage pull requests” permissions can abandon any PR in the repository.

If you are trying to clean up an old PR left behind by a former employee and the button is greyed out, you likely need to ask your Project Collection Administrator to grant you the “Contribute to pull requests” permission.

Conclusion

While you cannot hit a magic “Delete” button to delete a Pull Request from the database permanently, Abandoning is the functional equivalent for 99% of workflows. It stops the merge, cleans up your dashboard, and signals to the team that the code is dead.

You may also like the following articles:

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!