After you merge or close a pull request, you can delete the branch. This keeps the list of branches for your repository as clean and useful as possible.

Tip: You can only delete branches for repositories that you have push access to.

At the bottom of a merged or closed pull request, you’ll see a button to delete the lingering branch:

Delete Branch button

You can also delete branches from the Branches page. For more information see Viewing branches in your repository.

Restoring a deleted branch

If you accidentally delete a branch that you still need, you can restore any head branch of a closed pull request.

Restore Branch link