Here is my complete, step-by-step guide on how to recover a deleted branch in Azure DevOps, covering everything from the web portal to command-line saves.
How to recover deleted branch in Azure DevOps
Method 1: The Web Portal (The Easiest Method)
Log in to your Azure DevOps organization. Navigate to your Project, then hover over Repos in the sidebar and select Branches.
Step 2: Search for the Deleted Branch
By default, the “Mine” and “All” tabs only show active branches. If you scroll through the list, you won’t see your deleted branch.
- Locate the “Search all branches” box in the top right corner.
- Type the exact name of the deleted branch.
- Note: Partial matches often fail here. You need the full string, e.g.,
feature/login-updaterather than justlogin.
- Note: Partial matches often fail here. You need the full string, e.g.,
- Once you hit enter, you will likely see “No branches found.” Look closely for a link that appears below the search bar saying: “Search for exact match in deleted branches.”
Step 3: Restore the Branch
Click that link. Azure DevOps will query the recycle bin for that specific string.
- Your branch should appear in the list with a Deleted status.
- Hover over the row to find the actions menu (the three vertical dots
...). - Select the Restore branch. Check out the screenshot below for your reference.
