Perforce Command Reference:   [Index] [Prev] [Next]


p4 revert

Synopsis

Discard changes made to open files

Syntax

p4 [g-opts] revert [-c changelist#] file...

Description

p4 revert will discard changes made to open files, reverting them to the revisions last p4 sync'd from the depot. This command also removes the reverted files from the pending changelists with which they're associated.

When files that have been opened by p4 delete are reverted, the files are reinstated in the client workspace. Reversions of files that have been opened by p4 add will leave the client workspace files intact. Reversions of files opened through p4 integrate will remove the files from the client workspace.

Options

-c changelist# Reverts only those files in the specified changelist. To revert files in the default changelist, use the text value default for changelist#.
g_opts See global options section.

Usage Notes

Can File Arg Use
Revision Specifier?
Can File Arg
Use Revision Range?
Minimal
Access Level Required
No No open

Examples

p4 revert //depot/... Revert all open files to their pre-opened state.
p4 revert -c default Revert all open files in the default changelist to their pre-opened state.
p4 revert -c 31 *.txt Revert all files in changelist 31 with the suffix .txt in the current directory to their pre-opened state.

Related Commands

To open a file for add p4 add
To open a file for deletion p4 delete
To copy all open files to the depot p4 submit
To read files from the depot into the client workspace p4 sync
To list all opened files p4 opened
To bring the client workspace in sync with the files that Perforce thinks you have, clobbering open files p4 sync -f



Perforce Command Reference:   [Index] [Prev] [Next]


Copyright 1999 Perforce Software.
Contact us at [email protected]
Last updated: 09/15/99 (Manual version 99.1.cr.6)