.git folders or lost commit history. This backup system runs in the background, so your work is protected without any extra effort.
How it works
Every Replit App maintains a secure backup of your Git repository. When Replit Agent makes changes to the code or you deploy your app, they’re automatically synced to this backup. If your local Git repository becomes corrupted or unusable, you can restore your full commit history from the backup.The backup remote is named
gitsafe-backup and is managed automatically by Replit. You don’t need to configure anything—it’s already working in the background.Viewing your backup history
The easiest way to view your commit history is through the Git pane. Open it from the Tools section in your Workspace—it shows your full commit history including all Agent checkpoints. This works for most cases and doesn’t require any commands. If you need to inspect the gitsafe-backup remote directly, you can use the Shell:Recovering from Git issues
If you encounter Git errors or your repository becomes corrupted, start with the Git pane. It can resolve most common issues—like resetting to a previous commit or pulling from a remote—without needing Shell commands. For cases where the Git pane can’t help (such as a fully corrupted.git folder), use the Shell-based steps below.
Check if backup is available
First, verify that the backup remote exists:gitsafe-backup in the output. If it’s present, you can proceed with recovery.
Restore your repository
After completing these steps, run
git status to verify your repository is working correctly.
Troubleshooting common issues
”fatal: repository not found” or backup remote missing
The backup system may not be enabled for older projects. Contact support if you need help recovering an older project.Recovery didn’t include recent commits
Backups sync after each Agent commit. If you made changes but didn’t commit them, those changes won’t be in the backup. Check your working directory for any uncommitted files.Git operations are slow or hanging
If Git operations become unresponsive, you may have a stale lock file. You can safely remove it:Preventing data loss
While the backup system protects your Git history automatically, you can take additional steps to protect your work:- Commit frequently: Make small, frequent commits so your progress is continuously backed up
- Use checkpoints: When working with Replit Agent, checkpoints automatically create commits at key milestones
- Connect to GitHub: For critical projects, connect your app to GitHub for an additional layer of backup
Next steps
To learn more about version control on Replit:- Version control overview: Learn about all version control options
- Using the Git pane: Manage Git visually without command-line
- Checkpoints and Rollbacks: Understand how Agent checkpoints work