Skip to main content

恢复已删除的仓库

你可还原某些已删除的存储库以恢复其内容。

谁可以使用此功能?

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 us through the GitHub Support portal.

Important

You can only contact GitHub Support to restore a repository if you are on a paid GitHub plan. For more information about the different plans, see GitHub’s plans.

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. In the upper-right corner of any page on GitHub, click your profile photo, then click Settings.

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

  3. Under "Repositories", click Deleted repositories.

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

  4. Next to the repository you want to restore, click Restore.

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

  5. Read the warning, then click I understand, restore this repository.

Restoring a deleted repository that was owned by an organization

  1. In the upper-right corner of GitHub, select your profile photo, then click Your organizations.

  2. Next to the organization, click Settings.

  3. In the left sidebar, click Deleted repositories.

  4. Next to the repository you want to restore, click Restore.

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

  5. Read the warning, then click I understand, restore this repository.

Further reading