Edit

Share via


View the wiki page history and revert changes

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

This article describes 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.

Prerequisites

Category Requirements
Project access Member of the project where the wiki is located. If you don't have access, request it from your project administrator. Anyone with access to the team project can view the wiki, including Stakeholders.
Permissions - To add or edit wiki pages: Member of the Contributors group.
- To publish code as wiki: Create Repository permission. By default, this permission is set for members of the Project Administrators group.
Access levels At least Basic access.

View wiki page revision history

You can view the page history for a file in a provisioned wiki by following these steps:

  1. Sign in to your project (https://dev.azure.com/<Organization>/<Project>) in Azure DevOps.

  2. In the left navigation, select Wiki, and open the wiki page you want to view.

  3. In the wiki page view on the right, select More options > View revisions:

    Screenshot that shows how to select the View revisions option for a wiki page in the Azure DevOps web portal.

  4. The Revisions page shows who made changes to the page, along with the revision messages, the date for each change, and the version or commit ID.

    Screenshot that shows the revisions for a wiki page, including the change author, revision message, change date, and change version or commit ID.

  5. To review the changes made in a specific revision, select the message or version link to open the file.

    The wiki file opens in the Compare view that shows the file changes for that commit or version.

    Screenshot that shows the page revisions in the Compare view with changes visible side-by-side view.

    The review experience for revisions in Azure DevOps is similar to working with the Files changed view in GitHub. You can select Show diff side-by-side to compare the two versions of the file or Show diff inline to see the changes in a single pane:

    Screenshot that shows the view options for changes: Show diff side-by-side or Show diff inline.

  6. To review the prepublished Markdown (.md) content, select Preview.

To return to the initial view of the page or go back to the list of page revisions, use the breadcrumb navigation.

Note

The revision viewing experience is the same for a page in a published as code wiki but the Revert action isn't available.

Revert a commit for a provisioned wiki

You can revert a change on a wiki page by following these steps:

  1. Go to the Revisions page for the wiki file and open the specific revision that you want to apply to the page.

  2. When the wiki file opens, select Revert:

    Screenshot that shows how to select the Revert option for a wiki page revision.

  3. In the confirmation dialog, select Revert:

    Screenshot that shows the confirmation dialog to revert the page revision.

Revert a commit for a published as code wiki

To revert to an earlier revision for a page that you published as code, you have two options:

  • If the commit to apply is the most recent revision for the page, you can revert from the web portal.
  • If the commit is an earlier revision and there are more recent commits for the page, create a separate branch and do the revert in the branch.

Revert the page content in the web portal

To revert a wiki page from the most recent revision in the Azure DevOps web portal, follow these steps:

  1. Go to the Revisions page for the wiki file and locate the most recent revision.

  2. Copy the full ID for the revision commit by selecting Copy full SHA to clipboard:

    Screenshot that shows how to select the Copy to clipboard option for the full commit ID.

  3. Go to Repos > Commits, paste the copied commit ID into the Commit ID box, and select Search:

    Screenshot that shows how to enter the copied commit ID for the revision.

  4. On the Commit page, select More options > Revert:

    Screenshot that shows how to select the More options Revert action for the commit.

  5. In the Revert commit pane, select the Target branch for the commit, enter or select the Target branch name, and then select Revert:

    Screenshot that shows how to select or enter the target branch and branch name for the revert operation.

    The specified target branch is created with the reverted changes.

    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.

  6. Select Create Pull Request.

  7. In the New Pull Request dialog, select Create.

  8. In the Complete pull request dialog, select the Merge type. Optionally, select the checkboxes for options to complete after the merge.

  9. Select Complete merge to merge the changes into the main wiki branch:

    Screenshot that shows the Complete merge for the pull request to revert the page in the published code as wiki.

To view the reverted content, go to the wiki page and refresh the browser.

Revert from earlier revisions with a different branch

You can also revert to older committed version of a page in a published as code wiki by using a branch other than the main branch for the wiki. After the update to the other branch, you create a pull request to the main branch.

  1. Create a local branch of the main wiki branch.

  2. View the commit history and locate the commit with the changes to revert.

  3. Use the Revert command described earlier to revert the desired commit.

  4. When a conflict arises, use the conflict resolution tool to resolve the issues.

  5. Commit the changes to your local branch.

  6. Push the local branch to the remote server.

  7. Create a pull request for your local branch into the main branch for the wiki.

  8. Complete the pull request.