Skip to content

How do Drive file versions work?

These commands require the Drive CLI and an authorized session in the intended Socra Account.

Each content update creates an immutable file version. The file keeps its identity when its content changes or when it is renamed or moved. Older versions remain available in its history.

Before editing, get the current metadata and keep its current_version_id:

socra drive file get FILE_ID
socra drive file versions FILE_ID

If the version list has has_more: true, continue with --after LAST_ID, using the final version ID from that page. Repeat until you find the version you need.

Replace FILE_ID with the file's ID. After reviewing and editing the content locally, use the version you started from in place of VERSION_ID:

socra drive file write FILE_ID ./edited-notes.txt --version VERSION_ID

Drive rejects the write if another content version has become current. Download and review the new current content before deciding how to combine the changes. Replacing the version ID without reviewing the content can still discard someone else's intended edits.

To recover older content, download the chosen version to a new local path:

socra drive file download FILE_ID ./older-notes.txt --version OLDER_VERSION_ID

Review it, retrieve the current version ID, and write the recovered content as another new version. The earlier history remains. Reader access is enough to inspect or download versions; writing the recovered content requires writer or owner access.