Deleting and restoring branches in a pull request
If you have write access in a repository, you can delete branches that are associated with closed or merged pull requests. You cannot delete branches that are associated with open pull requests.
-
On GitHub Enterprise, navigate to the main page of the repository.
-
Under your repository name, click Pull requests.
-
Click Closed to see a list of closed pull requests.
-
In the list of pull requests, click the pull request that's associated with the branch that you want to delete.
-
Near the bottom of the pull request, click Delete branch.
Restoring a deleted branch
You can restore the head branch of a closed pull request.
-
On GitHub Enterprise, navigate to the main page of the repository.
-
Under your repository name, click Pull requests.
-
Click Closed to see a list of closed pull requests.
-
In the list of pull requests, click the pull request that's associated with the branch that you want to restore.
-
Near the bottom of the pull request, click Restore branch.