restore_drive_revision
Restore a Drive file to an earlier revision by re-uploading its previous content. Works for binary files like PDFs, DOCX, and images, preserving file ID and permissions.
Instructions
Restore a Drive file's content to a previous revision.
Downloads the raw bytes of the specified revision and re-uploads them as the file's current content. This creates a NEW revision identical to the old one (it does not rewind the revision history — older revisions remain accessible). Original file ID, name, and sharing permissions are preserved.
Requires OAuth scope: https://www.googleapis.com/auth/drive (write).
Large files (>100 MB) may take several seconds due to download+upload cycle.
Limitation: Google-native files (Docs, Sheets, Slides — MIME type
application/vnd.google-apps.*) do NOT expose raw revision content via
the Drive API. Attempting to restore a native file returns an explanatory
error. For those, open the file in Google Docs/Sheets/Slides and use the
built-in "Version history" UI (File > Version history > See version history).
Binary-content files (PDFs, DOCX, XLSX, images, ZIP, etc.) are fully
supported.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_google_email | Yes | ||
| file_id | Yes | Drive file ID (from a file URL like `drive.google.com/file/d/<file_id>/view`, or from `search_drive_files`). File must be a non-Google-native type. | |
| revision_id | Yes | ID of the revision to restore TO. Get it from `get_drive_revisions` — the `id` field on each revision entry. The revision must still be retained (pinned with `keepForever` OR within Drive's normal retention window). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |