I just submitted a Perforce (p4) changelist that I need to make a small modification to in order to correct a build. How do I unsubmit a recently submitted p4 changelist?
I just submitted a Perforce (p4) changelist that I need to make a small modification to in order to correct a build. How do I unsubmit a recently submitted p4 changelist?
Since 2016.2 a new command
p4 undo
is provided to make it easy to undo one or more changelists.For example,
This command will open in your workspace the files modified in Changelist 12345. Those files will have the content as of their previous revisions. Once you submit the opened files, the effects of Changelist 12345 are undone.
p4 undo
also supports revision ranges to undo multiple changelists at once.Note that if the files have been modified after the supplied changelist, you will need to
p4 sync
andp4 resolve
the files as normal.See here for more information: https://www.perforce.com/perforce/doc.current/manuals/cmdref/Content/CmdRef/p4_undo.html
You can use p4 sync, and edit/resolve/submit to back out a submitted changelist. For detailed instructions take a look at: https://community.perforce.com/s/article/3474
Hope that helps.
@Alan Wendt - Thank you, this is very helpful.
Just one addition - sometimes files are moved - not simply add/delete which leads to a bit different suffix. Here is fixed code which also resolved deletion and addition as parts of MOVE operation: