Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to revert a file line by line in P4

I want to revert part of changes in a file. I know in p4v you can easily revert files line by line. I am wondering how to do that using p4 command.

like image 530
Grace Shao Avatar asked Dec 20 '22 19:12

Grace Shao


1 Answers

Yes you can, assuming your using the default p4merge utility, follow this procedure:

  1. Right click on the file in your change-list.
  2. Select 'Diff against Workspace file'. (the workspace file is right panel and original is left)
  3. Select 'Edit' from the main top menu.
  4. Select 'Edit right pane'. (a 3rd pane at the bottom will appear which you can edit)
  5. Now browse your changes ...
  6. ... To remove a change, click the triangle shape on the right side. (shape icon turns blue)
  7. ... To add the change back, click the circle shape on the right side. (shape icon turns green)
  8. Quit the editor and save your changes and your done!

Does that help?

like image 161
Craig Avatar answered Jan 22 '23 17:01

Craig