# How do Drive file versions work?

Company: Socra — Multiply Your Judgment
Canonical URL: https://support.socra.com/articles/art_01m46em0nyta6rapgrmphrmxh6-versions

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`:

```sh
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`:

```sh
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:

```sh
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.

## Article details

- Collection: [Drive](https://support.socra.com/collections/col_01m3xcqhdaqyhcsd01zjxwda57-drive)
- Canonical: https://support.socra.com/articles/art_01m46em0nyta6rapgrmphrmxh6-versions
