Restore AI-generated code from GitHub.

A safe restore should recover a private GitHub checkpoint into a new folder, then let you compare files before copying anything back into the active project.

Quick answer

The safest way to restore AI-generated code is to avoid overwriting the current working folder. List recent remote checkpoints, restore the selected GitHub backup into a separate directory, open both copies side by side, and copy back only the files you actually need.

This matters because a broken AI coding session may still contain useful local edits. A destructive reset can remove both the bad changes and the useful work you wanted to keep.

Try safe restore on a test project

Install the alpha, create at least one private backup, then test restore into a sibling folder before using it on important work.

npm install -g aicodebackup@alpha
Install alpha

When restore is needed

Safe restore workflow

  1. Stop making more AI edits in the broken project.
  2. Run aicodebackup restore --list to inspect recent remote checkpoints.
  3. Choose the checkpoint that most likely contains the working version.
  4. Restore into a new folder outside the current project.
  5. Open the restored folder separately and verify that it runs.
  6. Compare the restored files with the current folder.
  7. Copy back only the files or sections you want to keep.

Why restore into a new folder

AI coding failures are rarely clean. The current folder may include a broken refactor, but it may also include useful copy, assets, UI details, or bug fixes that were created after the last backup. Restoring into a new folder protects both sides of the comparison.

This is slower than a hard reset, but it is easier to reason about for solo builders who are using Cursor, Claude Code, Codex, or another AI coding agent without a mature Git workflow.

What to check after restoring

Restore is not a substitute for backup rhythm

Restore only helps if there is a useful remote checkpoint to restore from. Create backups after working states and before risky prompts so the restore list contains real recovery choices instead of one stale commit.

FAQ

Will restore overwrite my current project?

AICodeBackup's safe restore model restores into a separate folder. That lets you inspect the recovered copy before changing the active project.

Which checkpoint should I restore?

Start with the most recent checkpoint before the broken AI edit. If that still contains the problem, restore an earlier checkpoint into another folder and compare.

Can I restore code from Cursor, Claude Code, or Codex projects?

Yes. The restore process depends on the private GitHub backup, not on which AI coding tool created the files.