This guide describes how to restore a deleted branch using AzDevOps.
Note: The following instructions only apply to restoring a branch that was on AzDevOps previously, and then deleted using AzDevOps. The process for restoring branches deleted by other means, or local branches, is beyond the scope of this guide.
You must know the name of the branch you want to recover.
As an example, this guide restores a deleted branch named old-branch to a sample AzDevOps repository example-repo. Modify the following instructions to suit your preferred AzDevOps repository (repo).
Prerequisites
Before you proceed complete the following:
- Install Visual Studio Code
- Install Docs Authoring Pack
- Install Word Count extension
- Install Pull Requests extension
- Install Azure Repos extension
- Install Git client
- Set Git credentials
- Terminology and concepts
- General project workflow
- Download course files (clone repo)
- Project branching policies
- Create new branch in VSC
- Send (push) files
Topics in this guide
Restore a deleted branch to AzDevOps
Complete the following steps to restore a deleted branch to AzDevOps.
-
Open a web browser, go to the AzDevOps website at https://dev.azure.com, and sign in.
-
On the Projects tab, locate the project repo with the branch you want to restore, and select the Repos icon.
For example, in the following image, the Repos icon for the project example-repo is selected.
-
Select Branches from the left side menu.
-
In the search box, upper right side, enter the name of the deleted branch you want to recover.
For example, in the following image, the name of the deleted branch old-branch is entered into the search box.
-
In the Deleted branches pane, select the vertical ellipsis (
⋮
) icon beside the branch you want recover (on the right side), and then choose Restore branch.For example, in the following image, the Restore branch option is selected for the deleted branch named old-branch.
-
The message Successfully restored <branch_name> indicates that the branch is recovered successfully.
The recovered branch is now available from the Branches pane, under the All tab.
For example, in the following image, the message Successfully restored old-branch indicates that the branch named old-branch is recovered successfully. In the following image, the branch old-branch is listed in the Branches pane, under the All tab.
You’ve recovered a branch using AzDevOps successfully.
Appendices
Check the following supplementary Appendices for more details and context.