Undoing changes

With Helix server 2017.1 and later, you can undo:

  • A single change made at a given changelist or revision while keeping subsequent changes.
  • A range of changes made at a given range of changelists or dates, or at a given label (of which you are the owner), while keeping subsequent changes.
  • All changes from a selected changelist, date, or label to the most recent version. The submitted files become the new head revision in the depot.

Note

Helix server does not undo integration records with p4 undo. When P4V undoes a merge event, it does undo the change but does not undo any integration history.

The Undo Changes dialog always opens in the context of the selected entity, which can be a workspace or depot folder or file, a changelist, a revision, or a label. For example:

When undoing a range, the Undo option creates the range according to the limit type:

You can preview the undo operation before submitting your changes. You can also specify a revision as the keyword "have." In this case, P4V applies the range for the files under the directory selection according to each file's "have" revision.

Important

When undoing rename or move operations, make sure to perform the undo option on the changelist that includes the rename or move operation. Otherwise, P4V will display an error message. p4 move and p4 rename operations are atomic in that you cannot split the move/add and move/delete pair.

P4V restores file state as follows:

  • Edited files: P4V restores the revision that precedes the one created when the changelist was submitted.
  • Deleted files: P4V restores the revision preceding deletion.
  • Added files: P4V deletes files that were added by the changelist.
Note

With Helix server 2016.2 and earlier, undoing changes was called rollback or back out and worked as described in Reverse a changelist submission in the P4V User Guide for version 2017.2.

To perform an undo operation:

  1. Select one of the following:

    • A folder in the Depot or Workspace tree
    • A file in the Depot or Workspace tree
    • A file revision on the file's History tab
    • A submitted changelist on the Submitted tab
  2. From the Actions menu, select Undo Changes.

  3. In the Undo Changes dialog, if needed, specify whether you want to undo a single change, a range of changes, or all changes from a selected point forward.

  4. Depending on your selection in step 3, specify a revision, changelist, date/time, or label, or a range of the same.
  5. Specify whether to check out the changes to a new or existing changelist.
  6. Optionally, to inspect the file affected by the changes, click Preview.
  7. Do one of the following:

    • Click Save to Changelist to integrate the changes to be undone into the specified changelist without submitting them just yet.
    • Click Submit to check out the files as specified and immediately submit them. This opens the Submit Changelist dialog box.

      By default, the changelist description in the Submit Changelist dialog box displays a comment similar to the following: "Undo <path to file or folder> to revision 3."

      Click Submit again to submit the changelist containing the files.

      P4V submits the changes.