API:Rollback/zh

回退
回退指的是撤销一系列由某用户进行的编辑. In other words, rollback keeps undoing revision after revision until it encounters one made by someone different. This functionality is identical to the one provided by the [ ] links in the graphical interface. 回退的版本将被标记为“小编辑”. 可选的是，回退与与被回退的编辑均可被标记为机器人操作，可在最近更改中默认不显示.

令牌
To rollback a page, a rollback token is required. If your wiki is using MediaWiki 1.24+, you can use action=query&meta=tokens&type=rollback to get a rollback token.

For MediaWiki 1.23 or earlier, follow these instructions:

Unlike most other tokens, rollback tokens aren't universal: they're not only different for every login, but also depend on the title of the page and the name of the user whose edits are to be rolled back. A rollback token can be obtained as follows:

Rolling back pages
Pages can be rolled back with action=rollback.

参数

 * : The page you want to roll back. Cannot be used together with pageid.
 * : Page ID of the page you want to roll back. Cannot be used together with title.
 * : The token obtained in the previous request. Take care to urlencode the '+' as '%2B'.
 * : The author of the last revision.
 * : Edit summary (optional). If not set, a default summary will be used.
 * : If set, both the rollback and the revisions being rolled back will be marked as bot edits.
 * : Unconditionally add or remove the page from your watchlist, use preferences or do not change watch. One value among: watch, unwatch, preferences, nochange.

例子
Note: In this example, all parameters are passed in a GET request just for the sake of simplicity. However, action=rollback requires POST requests; GET requests will cause an error.

Returned fields

 * : The revision ID of the rollback.
 * : The revision ID of the first (most recent) revision that was rolled back.
 * : The revision ID of the last (oldest) revision that was rolled back.

If rolling back wouldn't change the page, no new revision is made. In this case,  will be equal to.

Possible errors
In addition to the usual stuff: