Discard changes made to open files
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 they're associated with.
When files that have been opened by p4 delete are reverted, the files are reinstated in the client workspace. Reverts of files that have been opened by p4 add will leave the client workspace files intact. Reverts of files opened through p4 integrate will remove the files from the client workspace.
-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. |
p4 revert is unique in the Perforce universe in that it requires a file specification. The files that are reverted are those that lie in the intersection of the command line file specifications and the client workspace view.
Reverting a file that has been opened for edit will overwrite any changes made by the user to the file since the file was opened. Prudence suggests copying the file before running p4 revert.