gitgithubrepositorybranchgit-branch

How do I recover a deleted fork in GitHub?


I made a PR on a repository, deleted my fork and I can't access my PR branch anymore. It says unknown repository at the top now.

How do I get back to a PR branch in a deleted fork?

I tried to make a new fork, clone it and do git checkout nameofbranchfrompullrequest, but all the changes disappeared.


Solution

  • If I understood correctly:

    1. you forked a repo on GitHub
    2. you made some changes in the fork
    3. you submitted a PR to the original repo from your fork
    4. you deleted the fork
    5. now you want to recover the changes you made on the GitHub fork

    Once you delete a repo from GitHub you have to email support@github.com as soon as possible when this happens unless you have your forked repo still cloned somewhere on your computer.