> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library/versions.md).

# Version History and Restore

The file library has two types of version history. Most workspace changes (uploads, moves, deletions, and AI actions) can be undone. Each file retains its 20 most recent versions, which you can previe

The file library keeps two levels of history. **Workspace version history** records everything that happens in a workspace, while **a file’s version list** retains the previous contents of that file. Both support restoration, and restoring an item also creates a history entry.

## Use Case <a href="#use-case" id="use-case"></a>

A manager notices that the warranty information in the FAQ was changed incorrectly. She opens the version list for FAQ.md and sees that the latest version is labeled <mark style="color:blue;">Agent</mark>, with a note that a colleague confirmed it in a conversation and a link to that conversation. She previews the previous version, confirms that the content is correct, and clicks <mark style="color:blue;">Restore to this version</mark>. The file immediately returns to its previous contents, and a new entry labeled “Restored from v1” appears in the version list.

***

## Workspace Version History <a href="#workspace-activity" id="workspace-activity"></a>

Click <mark style="color:blue;">Version history</mark> (the clock icon) in the upper-right corner of the file library. The sidebar lists changes chronologically. Use <mark style="color:blue;">Scope</mark> at the top to choose which space or workspace to view. Changes you can undo have a restore icon on the right.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-d6701f648727c7e111e209509ec1acc1f71ca3fc%2Ffile-library-activity.png?alt=media" alt="Version history sidebar scoped to A1 Launch Proposal, listing events such as Applied to conversation, Workspace guide automatically updated, and Upload, with restore icons on the right of events that can be undone"><figcaption><p>Changes you can undo have a restore icon on the right</p></figcaption></figure>

Recorded events include:

| Type                 | Events                                                                                                                                     |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| Files                | Upload, Rename, Move, Delete, Restore, Content updated, Content restored                                                                   |
| Conversation-related | Session attachment (filing a conversation attachment), Session generation (AI output), Applied to conversation, Detached from conversation |
| Workspace guide      | Workspace guide automatically updated, Guide saved manually, Guide suggestions                                                             |

Session generation, Applied to conversation, and Detached from conversation are recorded for reference only and cannot be undone.

Actions performed by AI are labeled <mark style="color:blue;">Agent</mark> and include “Confirmed by \[name] in conversation” and the output conversation, so you can trace who approved the action and in which conversation.

{% hint style="info" %}

* Restoring an item adds another “Restore” event to the history.
* If the original location no longer exists (for example, the folder has been deleted), the entry displays “The original location no longer exists. Unable to restore.”
  {% endhint %}

***

## File Version List <a href="#file-versions" id="file-versions"></a>

### 1. Open the Version List <a href="#open-file-versions" id="open-file-versions"></a>

Click the file name to open its details, then click <mark style="color:blue;">Versions</mark>. This button appears only after the file has been modified (by AI, through online editing, or by uploading a new version). Newly uploaded files that have not been changed have no version list. The sidebar lists the file’s previous versions, including who saved each version and when, and whether Agent modified it. The version currently in use is labeled <mark style="color:blue;">Current version</mark>.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-663d979010acad8d8c04324e9910c3730dfc8224%2Ffile-library-file-versions.png?alt=media" alt="File version list showing v2 as the current version, labeled Agent and linked to the source conversation, with v1 below"><figcaption><p>Each version records who made and confirmed the changes</p></figcaption></figure>

### 2. Preview an Older Version <a href="#preview-version" id="preview-version"></a>

Click any older version to see a preview of its contents below.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-d536349bb6ce97a06983e9050d0a4d955ce54a5e%2Ffile-library-version-preview.png?alt=media" alt="Preview of v1 with a Restore to this version button in the upper-right corner"><figcaption><p>Preview an older version before deciding whether to restore it</p></figcaption></figure>

### 3. Restore to This Version <a href="#restore-version" id="restore-version"></a>

Click <mark style="color:blue;">Restore to this version</mark> and confirm. The system **creates a new version** using the older contents without deleting the versions in between. The new version is labeled <mark style="color:blue;">Restored</mark> and “Restored from v○.”

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-c001e58bef71b499ceac8335686ad14715cd1107%2Ffile-library-version-restored.png?alt=media" alt="Restoring creates v3, labeled Current version, Restored, and Restored from v1"><figcaption><p>Restoring also creates a new version</p></figcaption></figure>

{% hint style="warning" %}

* Each file retains its **20 most recent versions**. Older versions are removed automatically.
* Restoring a file version requires edit access to the workspace.
  {% endhint %}

***

## Related Pages <a href="#related" id="related"></a>

* [Let AI Edit and Organize Files](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library/ai-edit.md)
* [Online Editing](https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library/online-editing.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/maiagent-user-guide/en/work/file-library/versions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
