To restore a deleted branch in GitHub, follow these steps:
- Go to the GitHub repository if you want to restore a deleted branch.
- If the branch was deleted after a pull request was merged, go to the 'Pull requests' tab in your repository.
- Locate the closed pull request that used the deleted branch.
- You should see a 'Restore branch' button near the bottom of the pull request. Click this button to restore the branch.
- The history and contents of the restored branch will remain intact if done soon after deletion.