> 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/chuang-jian-nei-rong/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="broken://files/WVfSPMgIbWWq12Hy83TC" media="(prefers-color-scheme: dark)"><img src="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-9a6193f3753e7ee38b64b758c0e84a1946cd15c1%2F25_01_10_history_icon_light.svg?alt=media" alt="The Version history icon in GitBook"></picture> 按钮，或打开分区或更改请求标题旁边的 **操作菜单** <picture><source srcset="broken://files/HXFvPsjDqbaBEhpH0WKJ" media="(prefers-color-scheme: dark)"><img src="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-f73bf8251d7a6786ca6595b4593501e11512d107%2F25_02_04_actions_horizontal_1.svg?alt=media" alt="The Actions menu icon in GitBook"></picture> 并点击 **版本历史记录**.

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

### 显示更改

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

要启用或停用此功能，请使用 **显示更改** 开关，它位于 **版本历史记录** 侧边栏底部。

启用“显示更改”后，已更改的内容块左侧会显示一个图标进行高亮。

### 查看已发布历史版本

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

你可以通过以下方式来完成：

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

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

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

### 回滚到先前版本

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

要将分区回滚到之前的版本，请将鼠标悬停在侧边栏中的该版本上，点击 **操作按钮** <picture><source srcset="broken://files/YjlF3Z9KMYv9aQiFzZKD" media="(prefers-color-scheme: dark)"><img src="https://2111890564-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNkEGS7hzeqa35sMXQZ4X%2Fuploads%2Fgit-blob-aabbca522107ef561981bdfe5af94605b31e0920%2F25_01_10_actions_icon_light.svg?alt=media" 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 by asking a question.

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

```
GET https://gitbook.com/docs/documentation/zh/chuang-jian-nei-rong/version-control.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.
