title | titleSuffix | description | ms.subservice | ms.custom | ms.topic | ms.author | author | ms.reviewer | monikerRange | ms.date |
---|---|---|---|---|---|---|---|---|---|---|
Revert changes and find wiki page history |
Azure DevOps |
Add and update pages offline for your built-in team project wiki. |
azure-devops-wiki |
wiki, devdivchpfy22 |
how-to |
chcomley |
chcomley |
gopinach |
<= azure-devops |
11/21/2023 |
[!INCLUDE version-lt-eq-azure-devops]
This article shows you how to view the revision history of a wiki page in Azure DevOps. It also provides information on how to revert changes made to a wiki page.
[!INCLUDE wiki-prereqs-create-repository]
-
Sign in to your organization (
https://dev.azure.com/{yourorganization}
) and go to your wiki page. -
Select :::image type="icon" source="../../media/icons/more-actions.png" border="false"::: More actions > View revisions.
:::image type="content" source="media/wiki/wiki-page-revisions.png" alt-text="Screenshot of the context menu showing Print, Link work items, View revisions, and Delete options. The View revisions button is highlighted.":::
-
Revision pages show who made the change along with the revision message, date, and version or commit ID. To view details of a revision, select the message or version link.
::: moniker range="<=azure-devops"
:::image type="content" source="media/wiki/revision-history-vsts.png" alt-text="Screenshot of Page for a provisioned wiki page.":::
::: moniker-end
-
Similar to any git file revision, the revision details page provides a Show diff side-by-side view or the Show diff inline view. Choose Preview to see the content of the page of the specific revision.
:::image type="content" source="media/wiki/wiki-revision-details-2.png" alt-text="Screenshot of article revisions compared side-by-side. The article is in Markdown.":::
::: moniker range="<=azure-devops"
For a publish as code wiki page, similar information displays, but the Revert button isn't active.
::: moniker-end
-
Use the breadcrumbs to return to the page or revisions of the page.
Select Revert on the revision details page to revert a change on a wiki page.
:::image type="content" source="media/wiki/wiki-revert.png" alt-text="Screenshot fo the Dialog box revert revision. Revert option is selected.":::
::: moniker range="<=azure-devops"
To revert to an earlier revision for a page that you published as code, do one of the following actions:
- If the commit is the most recent revision to a page, you can revert from the web portal.
- If the commit is an earlier revision, with more commits having occurred in between, create a separate branch and revert the changes in that branch.
-
Preview any version by choosing the commit ID from the Revisions page for the selected file.
-
Copy the full ID of the commit by selecting :::image type="icon" source="../../media/icons/copy-clone-icon.png" border="false"::: Copy-clone.
:::image type="content" source="media/wiki/revert-publish-as-code-copy-commit-id.png" alt-text="Screenshot of Copy the full commit ID.":::
-
Go to Repos > Commits, paste the ID that you copied into the Commit ID box, and select :::image type="icon" source="../../media/icons/search-icon.png" border="false"::: Search.
:::image type="content" source="media/wiki/revert-publish-as-code-paste-commit-id.png" alt-text="Screenshot of Paste the commit ID for an earlier commit.":::
-
From the commit page, select :::image type="icon" source="../../media/icons/actions-icon.png" border="false"::: More actions, and then choose Revert.
:::image type="content" source="media/wiki/revert-publish-as-code-option.png" alt-text="Screenshot of Choose revert menu option of an earlier commit.":::
-
Confirm that you want to revert. Select Revert.
:::image type="content" source="media/wiki/revert-publish-as-code-commit-dialog.png" alt-text="Screenshot of Revert commit dialog.":::
A branch gets created with the reverted changes.
-
Select Create Pull Request.
If you receive an error message, you might need to create a local branch and make your changes manually as described in the next section.
-
Select Create in the New Pull Request form.
-
Select Complete merge to merge the changes into the main wiki branch. Optionally, add a check to the checkboxes to select post-completion options.
:::image type="content" source="media/wiki/revert-complete-pull-request-dialog.png" alt-text="Screenshot of Revert publish code as wiki, complete pull request.":::
To view the reverted content, return to the wiki and refresh the browser.
To revert to an earlier committed version of a publish as code wiki page, one that isn't the immediate last revision, update a branch other than the main branch for the wiki, and then create a pull request to the main branch.
- Create a local branch of the main wiki branch.
- View the commit history and locate the commit that contains the changes you want to undo.
- Use the revert command to revert the desired commit.
- When a conflict arises, use the conflict resolution tool to resolve the issues.
- Commit the changes to your local branch.
- Push the local branch to the remote server.
- Create a pull request for your local branch into main.
- Complete the pull request.
::: moniker-end