Revert files, to discard changes
To remove an open file from a changelist and discard any changes you
made, issue the p4 revert
command. When you revert a
file,
Helix Core Server
restores the last version you synced to your workspace. If you revert a
file that is open for add, the file is removed from the changelist but is
not deleted from your workspace.
Example Revert a file
Bruno decides not to add his text files after all.
C:\bruno_ws\dev> p4 revert *.txt
//Acme/dev/docs/manuals/installnotes.txt#none - was add, abandoned
//Acme/dev/docs/manuals/requirements.txt#none - was add, abandoned
To preview the results of a revert operation without actually reverting
files, specify the -n
option when you issue the p4
revert
command.