After merging a pull request, you deleted a branch from Git, both locally and remotely, and you want it back.
git log to see all commits made in reverse order, and find the one where the pull request was merged originally.
Copy the long SHA from the top of the entry (it looks something like
git checkout -b recover-branch <SHA you copied earlier>. You’ll check out a new branch named
off the SHA where the pull request was merged.
Push this to the remote with
git push -u origin recover-branch, and your branch is back, both locally and remotely.