> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/zh/creating-content/version-control.md).

# 版本控制

你可以使用以下方式监控人们对你内容所做的所有更改 **版本历史** 侧边栏。

### 版本历史 <a href="#see-the-activity-of-a-specific-draft" id="see-the-activity-of-a-specific-draft"></a>

在某个章节的版本历史中，你可以看到所有更改其中内容的操作列表。这些包括：

* 当有人对该章节进行了实时编辑时。
* 当有人合并了一个变更请求时。
* 当有人执行了 Git Sync 操作时。

### 查看内容的历史版本

要查看内容的过去版本并查看所做的更改，请点击 **版本历史** <picture><source srcset="/files/WVfSPMgIbWWq12Hy83TC" media="(prefers-color-scheme: dark)"><img src="/files/aa0c59dd27f79ad3cdc857a47d9ea0b0f1eabbaa" alt="The Version history icon in GitBook"></picture> 按钮，或打开 **操作菜单** <picture><source srcset="/files/HXFvPsjDqbaBEhpH0WKJ" media="(prefers-color-scheme: dark)"><img src="/files/950d2c0e21d4aa4c603de07a2bc5d827c0d5cbde" alt="The Actions menu icon in GitBook"></picture> 旁边的 **版本历史**.

点击列表中的任意项，即可查看在进行此更改时内容的样子。这与查看变更请求的方式非常相似。

### 显示更改

当你查看内容的旧版本时，你可以选择突出显示旧内容与当前内容之间的差异——类似于变更请求中的差异视图。

要启用或禁用此功能，请使用 **显示更改** 位于底部的切换开关 **版本历史** 侧边栏。

启用“显示更改”后，已更改的内容块左侧会用图标突出显示。

### 查看已发布版本的历史记录

如果你正在查看已发布章节的版本历史，你还可以在已发布上下文中预览之前版本的样子（即最终用户会看到的内容）。

你可以通过以下方式实现：

{% stepper %}
{% step %}
在版本历史侧边栏中，选择该修订版本
{% endstep %}

{% step %}
复制 URL 末尾的 ID
{% endstep %}

{% step %}
将其添加到已发布文档 URL 的末尾，格式为 `/~/revisions/<id>`
{% endstep %}
{% endstepper %}

### 回滚到以前的版本

回滚可让你将某个章节的内容恢复到先前某个时间点的状态。如果你不小心做了破坏性更改或删除了内容，并需要快速恢复到该章节的先前版本，这会很有帮助。

要将章节回滚到以前的版本，请将鼠标悬停在侧边栏中的该版本上，点击 **操作按钮** <picture><source srcset="/files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="/files/d05670ba93b683794fb3fe95a9fc7ab5c7fceafd" alt="The Actions menu icon in GitBook"></picture> 然后点击 **回滚**.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/zh/creating-content/version-control.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
