{
  "name": "version-history",
  "title": "Version History & Rollback",
  "description": "File version history and rollback: view versions, restore individual files, roll back to any point in time",
  "guid": "sk_plat_ckpt",
  "category": "Agent Tools",
  "requiredTools": [
    "file_versions",
    "file_version_restore",
    "rollback"
  ],
  "content": "# Version History & Rollback\n\nEvery file write is automatically tracked with an immutable version history. You can view, restore, and roll back files at any time - no manual snapshots needed.\n\n## Tools\n\n### file_versions\nList the version history of any file. Shows version numbers, timestamps, sizes, and sources.\n\n```\nfile_versions({ path: \"src/index.html\" })\n```\n\n### file_version_restore\nSwitch a file to any version - older or newer. No data is lost; it just changes which version is active.\n\n```\nfile_version_restore({ path: \"src/index.html\", version: 2 })\n```\n\n### rollback\nRestore files and folders under a path to their state at a given point in time. Supports scoping to a specific directory and recursive/non-recursive modes.\n\n```\nrollback({ datetime: \"2026-04-08T14:30:00Z\" })                          // entire project\nrollback({ datetime: \"2026-04-08T14:30:00Z\", path: \"src/components\" })  // one folder, recursive\nrollback({ datetime: \"2026-04-08T14:30:00Z\", path: \"src\", recursive: false })  // direct children only\nrollback({ datetime: \"latest\" })                                                // undo previous rollback\n```\n\n## How It Works\n- Every file write creates an immutable version with a timestamp\n- `file_version_restore` switches which version is active - all versions are preserved\n- `rollback` derives the project state at any point in time from the version history\n- Rollback handles both files (version-based) and folders (timestamp-based)\n- Files created after the target time are removed; files that existed are restored\n- All operations are wrapped in a transaction - atomic and safe\n\n## When to Use\n- User says \"undo that\" → use `file_versions` + `file_version_restore` for one file\n- User says \"go back to before I changed everything\" → use `rollback` with a datetime\n- Something broke after a series of changes → `rollback` to before the changes\n- Compare what changed → `file_versions` shows the full timeline per file"
}
