Skip to main content

Restoring a deleted repository

You can restore some deleted repositories to recover their contents.

Who can use this feature

Anyone can restore deleted repositories that were owned by their own personal account. Organization owners can restore deleted repositories that were owned by the organization.

About repository restoration

A deleted repository can be restored within 90 days, unless the repository was part of a fork network that is not currently empty. A fork network consists of a parent repository, the repository's forks, and forks of the repository's forks. If your repository was part of a fork network, it cannot be restored unless every other repository in the network is deleted or has been detached from the network. For more information about forks, see "About forks."

If you want to restore a repository that was part of a fork network that is not currently empty, you can contact GitHub 支持.

It can take up to an hour after a repository is deleted before that repository is available for restoration.

Restoring a repository will not restore release attachments or team permissions. Issues that are restored will not be labeled.

Restoring a deleted repository that was owned by a personal account

  1. 在任何页面的右上角,单击个人资料照片,然后单击“设置”。

    用户栏中的 Settings 图标

  2. In the "Code planning, and automation" section of the sidebar, click Repositories.

  3. 在“存储库”下,单击“已删除的存储库”。 “已删除的存储库”选项卡

  4. 在要还原的存储库旁边,单击“还原”。 “还原”按钮

  5. 阅读警告,然后单击“我明白,还原此存储库”。 确认还原的按钮

Restoring a deleted repository that was owned by an organization

  1. 在 GitHub.com 的右上角,单击你的个人资料照片,然后单击“你的组织”。 贵组织在配置文件菜单中
  2. 在组织旁边,单击“设置”。 设置按钮
  3. 在左侧边栏中,单击“已删除的存储库”。 “已删除的存储库”选项卡
  4. 在要还原的存储库旁边,单击“还原”。 “还原”按钮
  5. 阅读警告,然后单击“我明白,还原此存储库”。 确认还原的按钮

Further reading