Eric
Eric

Reputation: 177

Recover commits of a repository

I deleted a repository after I did serveral commits that by uploading file.Then I created a new repository given the same name of the previous repository, I can only find 21 commits now,but there exists 37 commits actually, is it possible to recover the other 16 commits? how to recover it ? enter image description here

Upvotes: 0

Views: 77

Answers (1)

Matt
Matt

Reputation: 13973

Some deleted repositories on GitHub can be restored within 90 days. It might take up to an hour (after deletion) for a repository to be available for restoration. If it does not show up yet, be patient. The deleted repository must have been owed by your user account, or by the organisation account if it was owned by an organisation account.

First, you need to make sure that you don't have a repository with the same name as the one you want to restore. Rename the newly created repository and give it a meaningful name to differentiate them easily.

Then, you can restore the repository like this:

  1. Go to the settings page of your user account
  2. Click Repositories in the sidebar
  3. Navigate to the Deleted repositories tab
  4. Click Restore for the desired repository
  5. Make the repository private if desired (it is public by default) and configure team or collaborator permissions (they are not restored)

There is an individual entry for each deleted repository even if the name was the same or there is currently a repository with the same name.

If you have waited more than one hour and the repository does not show up in the list, you can create a ticket for GitHub Support on the topic Restore deleted data.

If you are using GitHub Enterprise Server, contact the support team of your organisation.


Step 1 & 2: Step A


Step 3 & 4: Step B

Upvotes: 1

Related Questions