Restore a deleted Git branch from the web portal
TFS 2018
This article addresses how to restore a deleted Git branch using the web portal in Azure Repos. If you need to restore a Git branch in your own repo from Visual Studio or the command line, push your branch from your local repo to Azure Repos to restore it.
Note
There is no retention policy on deleted branches. A deleted Git branch can be restored at any time, regardless of when it was deleted.
Open your repo on the web and select the Branches view.
Search for the exact branch name using the Search all branches box in the upper right.
Click the link to Search for exact match in deleted branches. If there is a deleted branch that matches your search, you will be able to see which commit it pointed to when it was deleted, who deleted it, and when it was deleted.
To restore the branch, select the ... icon next to the branch name and then select Restore branch from the menu. The branch will be recreated at the last commit to which it pointed. Note that branch policies and permissions will not be restored.
If you've re-used the same branch name for different commits, you may not see all the commits you're expecting when you restore the deleted branch. In that case, navigate to the Pushes page of the restored branch to see the entire history of the branch.
You can navigate to a specific commit, then select New branch from the ... icon. From there, you can use a pull request, cherry-pick, or merge to get the commits back into the desired branch.