> 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/ja/work/file-library/versions.md).

# バージョン履歴と復元

ファイルライブラリには 2 種類のバージョン履歴があります。ワークスペースの変更履歴（アップロード、移動、削除、AI の操作）は多くの場合、元に戻せます。個別ファイルのバージョン一覧には直近 20 版が保持され、任意のバージョンをプレビューして復元できます。

ファイルライブラリには 2 層の履歴があります。**ワークスペースのバージョン履歴**には、そのワークスペース内で発生したすべての操作が記録されます。**ファイルのバージョン一覧**には、同じファイルの過去の内容が保持されます。どちらも元に戻すことができ、復元操作そのものも記録されます。

## 利用シーン <a href="#use-case" id="use-case"></a>

管理者が FAQ の保証に関する説明が誤って変更されていることに気づきます。FAQ.md のバージョン一覧を開くと、最新版には <mark style="color:blue;">Agent</mark> と表示され、同僚が会話中に確認したことと、その元の会話へのリンクが示されています。一つ前のバージョンをプレビューして内容が正しいことを確認し、<mark style="color:blue;">このバージョンに復元</mark> をクリックすると、ファイルはすぐに元の内容に戻り、バージョン一覧に「v1 から復元」が追加されます。

***

## ワークスペースのバージョン履歴 <a href="#workspace-activity" id="workspace-activity"></a>

ファイルライブラリの右上にある <mark style="color:blue;">バージョン履歴</mark>（時計アイコン）をクリックすると、サイドバーに変更が時系列で表示されます。上部の <mark style="color:blue;">範囲</mark> で、表示するスペースやワークスペースを切り替えられます。取り消せる変更の右側には、復元アイコンが表示されます。

<figure><img src="https://2584873290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTvHx8hgwYGDTLD3A7xoW%2Fuploads%2Fgit-blob-d6701f648727c7e111e209509ec1acc1f71ca3fc%2Ffile-library-activity.png?alt=media" alt="範囲が「A1 上場提案」のバージョン履歴サイドバーに、会話への適用、ワークスペースガイドの自動更新、アップロードなどのイベントが並び、取り消せるイベントの右側に復元アイコンが表示されています"><figcaption><p>取り消せる変更の右側には復元アイコンがあります</p></figcaption></figure>

記録されるイベントは次のとおりです。

| 種類         | イベント                                                         |
| ---------- | ------------------------------------------------------------ |
| ファイル       | アップロード、名前変更、移動、削除、復元、内容の更新、内容の復元                             |
| 会話関連       | Session 添付（会話の添付ファイルの格納）、Session 生成（AI による生成）、会話への適用、会話からの解除 |
| ワークスペースガイド | ワークスペースガイドの自動更新、ガイドの手動保存、ガイドの更新案                             |

Session 生成、会話への適用、会話からの解除は記録のみで、元に戻すことはできません。

AI が実行した操作には <mark style="color:blue;">Agent</mark> と表示され、「○○が会話中に確認」と生成元の会話が記載されます。誰がどの会話で承認したかを追跡できます。

{% hint style="info" %}

* 元に戻すと、新たに「復元」イベントが記録されます。
* 元の場所が存在しない場合（フォルダが削除されている場合など）は、「元の場所が存在しないため、復元できません」と表示されます。
  {% endhint %}

***

## ファイルのバージョン一覧 <a href="#file-versions" id="file-versions"></a>

### 1. バージョン一覧を開く <a href="#open-file-versions" id="open-file-versions"></a>

ファイル名をクリックしてファイルの詳細を開き、<mark style="color:blue;">バージョン</mark> をクリックします。このボタンは、ファイルが変更された後（AI による編集、オンライン編集、新バージョンのアップロード）に表示されます。アップロード直後でまだ変更されていないファイルには、バージョン一覧はありません。サイドバーには、そのファイルの過去のバージョンが表示され、誰がいつ保存したか、Agent が変更したかを確認できます。使用中のバージョンには <mark style="color:blue;">現在のバージョン</mark> と表示されます。

<figure><img src="https://2584873290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTvHx8hgwYGDTLD3A7xoW%2Fuploads%2Fgit-blob-663d979010acad8d8c04324e9910c3730dfc8224%2Ffile-library-file-versions.png?alt=media" alt="ファイルのバージョン一覧に、現在のバージョンとして v2 が表示され、Agent と元の会話が示されています。その下には v1 があります"><figcaption><p>各バージョンに変更者と確認者が記録されます</p></figcaption></figure>

### 2. 以前のバージョンをプレビューする <a href="#preview-version" id="preview-version"></a>

以前のバージョンをクリックすると、その内容のプレビューが下に表示されます。

<figure><img src="https://2584873290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTvHx8hgwYGDTLD3A7xoW%2Fuploads%2Fgit-blob-d536349bb6ce97a06983e9050d0a4d955ce54a5e%2Ffile-library-version-preview.png?alt=media" alt="v1 の内容のプレビューと、右上の「このバージョンに復元」ボタン"><figcaption><p>以前の内容をプレビューしてから、復元するかを決められます</p></figcaption></figure>

### 3. このバージョンに復元 <a href="#restore-version" id="restore-version"></a>

<mark style="color:blue;">このバージョンに復元</mark> をクリックして確認すると、以前の内容で**新しいバージョンが作成されます**。その間のバージョンは削除されません。新しいバージョンには <mark style="color:blue;">復元済み</mark> と「v○ から復元」が表示されます。

<figure><img src="https://2584873290-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTvHx8hgwYGDTLD3A7xoW%2Fuploads%2Fgit-blob-c001e58bef71b499ceac8335686ad14715cd1107%2Ffile-library-version-restored.png?alt=media" alt="復元によって v3 が作成され、現在のバージョン、復元済み、v1 から復元と表示されています"><figcaption><p>復元操作でも新しいバージョンが作成されます</p></figcaption></figure>

{% hint style="warning" %}

* 各ファイルには**直近 20 個のバージョン**が保持され、それ以前のバージョンは自動的に削除されます。
* ファイルのバージョンを復元するには、そのワークスペースの編集権限が必要です。
  {% endhint %}

***

## 関連ページ <a href="#related" id="related"></a>

* [AI にファイルの編集・整理を依頼する](https://docs.maiagent.ai/maiagent-user-guide/ja/work/file-library/ai-edit.md)
* [オンライン編集](https://docs.maiagent.ai/maiagent-user-guide/ja/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/ja/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.
