Downloading & Restoring
Download archives and restore your code from backups.
Downloading Archives#
To download a full archive backup:
- Go to your project's Backups tab
- Find the archive backup you want to download
- Click the Download button
- The ZIP file will download to your computer
Archive backups contain all files from your repository at the time of backup.
Restoring from Git Reference#
Git reference backups store the commit SHA, allowing you to restore using Git commands:
- Find the backup in your Backups tab
- Copy the commit SHA shown for that backup
- Use Git to restore to that commit
Restore Commands
To view the state of your code at a specific commit:
git checkout <commit-sha>
To reset your branch to a previous commit (use with caution):
git reset --hard <commit-sha> git push --force origin main
Force Push Warning
Using git reset --hard and force push will overwrite remote history. Make sure this is what you want before proceeding.
Restoring from Archive#
To restore from a downloaded archive:
- Extract the ZIP file to a folder
- Review the files to confirm they contain what you need
- Copy files to your project directory, or initialize a new Git repository
Archive Recovery
Archive backups are useful when your GitHub repository has been deleted or corrupted. They provide a complete standalone copy of your code.