p4 undo

Synopsis

Undo a range of revisions.

Syntax

p4 [g-opts] undo [-n] [-c change] file[revRange]

Description

The p4 undo command opens files in order to undo a set of previously submitted changes. The "undone" changes remain a part of the file history, but the new revisions submitted after p4 undo reverse their effect.

If a single revision is specified, the specified revision is undone. If a revision range is specified, the entire range is undone.

The workspace files opened by p4 undo are synced to the revision prior to those of the range being undone and opened at the most recent undone revision. Files that are opened at a revision prior to the head must be resolved prior to submission; to accomplish this, run p4 sync followed by p4 resolve.

Options

-n

Preview the operation without changing any files.

-c change

Open files in the specified pending changelist rather than the default changelist.

g-opts

See “Global Options”.

Usage Notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required

Yes

Yes

open

To undo the effects of a particular change, issue this command:

$ p4 undo @change

To undo all changes made on April 1, 2016, issue this command:

$ p4 undo @2016/04/01,@2016/04/02

The above examples open files in the default changelist. To use a numbered changelist, specify it with the -c option.