Rolling Back to an Earlier Version of a File—Git

One of the benefits of Flare's integrated source control is that you can view the history and differences for a particular file. You can view code and content differences between two source control versions of the same file. This is useful if you need to roll back to an earlier version of a file.

See Viewing the History of Source Control Files—Git and Viewing Differences in Source Control Files—Git.

Example You have been working on a particular topic for a few days. Each day you pull the remote commits to your local database, make your changes, and commit and push the file back to the remote repository at the end of the day. At a certain point, you determine that you need to "roll back" to an earlier version of the file, using it to replace the latest version. Therefore, you use this feature to view the highlighted differences between the current version and an older version of the file. Once you have identified the older version that you want to use, you can retrieve that version.

How to Roll Back to an Earlier Version of a File

  1. In one of the window panes (e.g., Content Explorer, Source Control Explorer, File List, Project Organizer, Pending Changes window pane), select the relevant file(s).

    OR

    Open a file.

  2. Do one of the following, depending on the part of the user interface you are using:
    • Ribbon Select Source Control > View History.

    • Right-Click If you have the Content Explorer, Project Organizer, Pending Changes window pane, or File List open, right-click the file you want to roll back and select Source Control > View History.
    • Source Control Explorer With the Pending Changes pane open, right-click the file you want to roll back and select View History.

    The History dialog opens.

  3. (Optional) View the differences between two versions of the file. This may help you decide which version of the file you want to retrieve. (Another way is to look at the dates for each version in the History dialog.)

    To view the differences, follow these steps.

    1. Select the first file version from the list.
    2. Hold the CTRL key and select the second file version from the list.
    3. Click Show Differences. The Differences Editor opens to the right, showing content from the backup file on the left and the current version of the file on the right.
    4. In the local toolbar of the Differences Editor, you can click any of the following to make adjustments.
      • Options Click this to open the File Differences dialog, which lets you change the colors used to display content differences between the files. See Setting Color Options for Project File Differences—Subversion.
      • Show WYSIWYG Click this to switch from tag view to WYSIWYG (What You See Is What You Get) view.
      • The Differences Editor displayed in WYSIWYG format rather than with tags.

      • Ignore Case Click this to ignore changes in case when viewing differences. This option can be used in "text view" only; it is not available in WYSIWYG view.

        Example If a word is not capitalized in the original file but it is capitalized in the current file, this option does not highlight those differences.

        The Differences Editor not set to ignore case in lettering, and highlights any inconsistencies.

        The Differences Editor set to ignor case in lettering.

      • Ignore Whitespace Click this to ignore whitespace when viewing differences.

        Example A paragraph is identical in both files, except for an extra space that was added within the paragraph in one of those files. If you click this option, that difference is not highlighted.

        The Differences Editor is not set to ignore whitespace, and highlights odd spacing.

        The Differences Editor set to ignore whitespace.

    5. When you are finished viewing the differences, close the window pane.
  4. In the History dialog, select the version of the file to which you want to roll back.
  5. Click Get Selected Version. That file is retrieved from the server and replaces the local copy of the file in your project.
  6. In the History dialog, click Close.