跳至主要内容

恢复已删除的仓库

您可以恢复某些已删除的仓库以恢复其内容。

谁可以使用此功能?

任何人都可以恢复其个人账户拥有的已删除仓库。组织所有者可以恢复组织拥有的已删除仓库。

关于仓库恢复

已删除的仓库可在 90 天内恢复,除非该仓库曾是一个非空的分叉网络的一部分。分叉网络包括父仓库、该仓库的分叉以及分叉的分叉。如果您的仓库曾是分叉网络的一部分,则只有在网络中的所有其他仓库均已删除或已从网络中分离时,才可以恢复。有关分叉的更多信息,请参阅 关于分叉

如果您想恢复的仓库属于当前非空的分叉网络,可通过 GitHub 支持门户 与我们联系。

重要提示

仅当您使用付费的 GitHub 计划时,才能联系 GitHub 支持来恢复仓库。有关不同计划的更多信息,请参阅 GitHub 的计划

仓库删除后,可能需要最多一小时才能再次进行恢复操作。

恢复仓库不会恢复团队权限。已恢复的议题(Issues)将不会带有标签。

恢复个人账户拥有的已删除仓库

  1. 在 GitHub 任意页面的右上角,点击您的个人资料图片,然后点击 设置

  2. 在侧边栏的 “代码、规划和自动化” 部分,点击 仓库

  3. 在 “仓库” 下,点击 已删除的仓库

    Screenshot of the "Repositories" settings page. Above a list of repositories, a gray "Deleted repositories" link is outlined in orange.

  4. 在您想恢复的仓库旁边,点击 恢复

    Screenshot of a list entry for the "octocat/hello-world" repository. To the right of a repository's name, the "Restore" button is outlined in orange.

  5. 阅读警告,然后点击 我已了解,恢复此仓库

恢复组织拥有的已删除仓库

  1. 在 GitHub 右上角,点击您的个人资料图片,然后点击 组织

  2. 点击即可选择组织。

  3. 在您的组织名称下,点击 设置。如果看不到 “设置” 选项卡,请选择 下拉菜单,然后点击 设置

    Screenshot of the tabs in an organization's profile. The "Settings" tab is outlined in dark orange.

  4. 在左侧边栏,点击 已删除的仓库

  5. 在您想恢复的仓库旁边,点击 恢复

    Screenshot of a list entry for the "octocat/hello-world" repository. To the right of a repository's name, the "Restore" button is outlined in orange.

  6. 阅读警告,然后点击 我已了解,恢复此仓库

延伸阅读

© . This site is unofficial and not affiliated with GitHub, Inc.