Can my deleted GitHub fork be restored after 90 days? #209975
Replies: 3 comments
|
Unfortunately there's no official way to restore a repository after the 90-day window — once it drops off Settings → Repositories → Deleted repositories, GitHub has purged it, and Support generally can't bring it back. (Forks are also restricted even inside the window if the fork network has changed.) The good news: your work isn't lost. GitHub keeps every PR's head commit on the upstream repo under a hidden ref, so you can rebuild the fork with the exact same commits: # 1. Fork oatpp/oatpp again (same name), then:
git clone http://github.com/<you>/oatpp.git
cd oatpp
git remote add upstream http://github.com/oatpp/oatpp.git
# 2. Pull the original PR's commits straight from upstream
git fetch upstream pull/1077/head:frontend-changes
git log -1 frontend-changes # should show 8c9744a
# 3. Push and open a new PR
git push origin frontend-changesThen open a new PR from A couple of notes:
|
|
One important correction to the earlier reply: GitHub’s documented restore path only covers repositories that still appear under Settings → Repositories → Deleted repositories (normally within 90 days, with extra restrictions for fork networks). Once the fork has disappeared from that list, GitHub does not document a way to restore the original fork relationship. You can still try to preserve the PR’s work while its ref is available: git fetch http://github.com/oatpp/oatpp.git pull/1077/head:frontend-changesIf that succeeds, verify the commit locally, push the branch to a new fork, and open a replacement PR linking #1077. GitHub does not guarantee that the References: https://docs.github.com/en/enterprise-cloud@latest/repositories/creating-and-managing-repositories/restoring-a-deleted-repository and https://docs.github.com/en/enterprise-cloud@latest/pull-requests/reference/forks If this gives you a workable recovery path, please mark it as the answer. |
|
Hey there! 👋 Thanks for posting in the GitHub Community, @Madhav-Soni! You are more likely to get a useful response if you are posting in the applicable category. The Copilot Conversation category is a place for our community to discuss and provide feedback on GitHub Copilot and supported IDEs like VS Code, Visual Studio, Jetbrains and more. GitHub Copilot is an AI pair programmer that offers autocomplete-style suggestions as you code. I've gone ahead and moved this to the correct category for you. Good luck! |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Question
💬 Feature/Topic Area
Copilot in GitHub
Body
Hi GitHub Community,
I accidentally deleted my fork of oatpp/oatpp and want to restore the original fork so it appears on my GitHub profile again.
I submitted this pull request with my frontend changes:
oatpp/oatpp#1077
The PR was closed because I deleted the head repository. However, the PR timeline and Files changed tab are still accessible. The associated commit is 8c9744a (frontend changes), and the PR displays 561 changed files.
My fork no longer appears under Deleted repositories because it is outside the 90-day restoration window. I contacted GitHub Support, but my ticket was closed with a referral to self-service resources.
Is there any official way to recover the original fork or have GitHub review its restoration? My goal is to preserve the original fork relationship and make my contribution visible on my profile, rather than create a replacement repository.
Thank you!
All reactions