How to restore a branch you deleted in GitHub
This guide shows how to find a deleted branch in the pull request that used it, restore it in one action, and confirm the commits are back.
Before you start
- A GitHub account with write access to the repository
- A pull request that used the deleted branch
Interactive guide
What you will do
This guide shows how to find a deleted branch in the pull request that used it, restore it in one action, and confirm the commits are back. When you finish, the change is saved in GitHub and you can confirm it without leaving the screen you ended on.
Steps at a glance
- Open the pull request that used the branch
- Find the branch notice in the timeline
- Select Restore branch
- Confirm the commits are present
Notes and limitations
Restoring from a pull request works only while the reference is still in the repository. If the branch was never pushed, recovery has to happen in your local clone instead.
Something changed?
Software changes quickly. Tell us if a step is inaccurate or no longer matches the product.
Report an outdated stepWant guides like this for your product?
Alex Hints creates interactive guide libraries for onboarding, support, releases, and training.