Jump to content


How to rollback to a changelist using a command line(Not Gui)


  • Please log in to reply
2 replies to this topic

#1 Mohannad

Mohannad

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 19 July 2018 - 02:23 PM

Hello,

I am a perforce beginner user.
I am writing a script that adds, deletes and edits files and revert all changes at the end.

I tried to do the following to revert all changes:

p4 sync <path>  @oldRevision
p4 add <path>                                    # to add the deleted files
p4 sync
p4 resolve -ay
p4 submit


and this revert all changes and the deleted files but it does not remove the new added files.
How can I remove the new added file?

Thanks in advance
Mohannad

#2 p4rfong

p4rfong

    Advanced Member

  • Staff Moderators
  • 293 posts

Posted 20 August 2018 - 06:30 PM

To rollback a newly added file, simply delete the file
p4 delete <path>

or better
p4 delete <path> @<Changelist_where_file_was_added>,@>Changelist_where_file_was_added>

#3 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 667 posts

Posted 20 August 2018 - 10:45 PM

The way to roll back everything without having to run different commands for different kinds of actions is the "p4 undo" command:

https://stackoverflo...and-linenot-gui




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users