Revert command options.

Namespace: Perforce.P4
Assembly: p4api.net (in p4api.net.dll) Version: 2017.3.160.836 (2017.3.160.0836)

Syntax

C#
public RevertCmdOptions(
	RevertFilesCmdFlags flags,
	int changelist
)
Visual Basic
Public Sub New ( _
	flags As RevertFilesCmdFlags, _
	changelist As Integer _
)
Visual C++
public:
RevertCmdOptions(
	RevertFilesCmdFlags flags, 
	int changelist
)

Parameters

flags
Type: Perforce.P4..::..RevertFilesCmdFlags
changelist
Type: System..::..Int32

Return Value

Remarks


p4 help revert

revert -- Discard changes from an opened file

p4 revert [-a -n -k -w -c changelist# -C client] file ...

Revert an open file to the revision that was synced from the depot,
discarding any edits or integrations that have been made. You must
explicitly specify the files to be reverted. Files are removed from
the changelist in which they are open. Locked files are unlocked.

The -a flag reverts only files that are open for edit, add, or
integrate and are unchanged or missing. Files with pending
integration records are left open. The file arguments are optional
when -a is specified.

The -n flag displays a preview of the operation.

The -k flag marks the file as reverted in server metadata without
altering files in the client workspace.

The -w flag causes files that are open for add to be deleted from the
workspace when they are reverted.

The -c flag reverts files that are open in the specified changelist.

The -C flag allows a user to specify the workspace that has the file
opened rather than defaulting to the current client workspace. When
this option is used, the '-k' flag is also enabled and the check for
matching user is disabled. The -C flag requires 'admin' access, which
is granted by 'p4 protect'.

See Also