You can restore the state of a file or folder in two ways:
Undo restores a file or folder back to a specified changelist, date, revision number, or label. Any changes made after that point in time are not retained.
The Undo option runs the p4 undo
command. You select a revision to "undo to." This is also called the selected revision. As such, undo operates on a range from the head revisionThe most recent revision of a file within the depot. Because file revisions are numbered sequentially, this revision is the highest-numbered revision of that file. back to the selected revision +1. The operation undoes everything back to (but not including) the revision that is being "undone to," and the selected revision is preserved. This range-focused type of undo does not require any extra syncs or resolves: the undo
command that P4V calls takes care of the entire operation.
The Undo option creates a range according to the limit type:
This works even if the +1 changelist or +1 date/time has no associated server entry. 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 +1.
For any limit type, if the selected file(s) are already at the head revision, there is nothing to undo.
To perform an undo operation:
Select one of the following:
From the Actions menu, select Undo.
Do one of the following:
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; they are now the new head revision in the depot.