files_restore
Restore a file's on-disk content from a specific git commit hash and re-index full-text search to undo accidental edits or recover a known-good version.
Instructions
DESTRUCTIVE. Overwrite a file's current on-disk content with the version recorded at a specific git commit, then re-index FTS. The hash MUST come from files_get_history for THIS file (foreign hashes throw). The current uncommitted content is lost unless it was already committed elsewhere. The file watcher may also pick up the change before this returns. No external auth or rate limits. Returns {file_id, path, hash, success, message}. Use only to undo accidental edits or recover a known-good version.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hash | Yes | Commit hash to restore from (from get_history) | |
| file_id | Yes | ID of the file |