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.
                 
                                                                            
                            Yes you can, assuming your using the default p4merge utility, follow this procedure:
- Right click on the file in your change-list.
 
- Select 'Diff against Workspace file'. (the workspace file is right panel and original is left)
 
- Select 'Edit' from the main top menu.
 
- Select 'Edit right pane'. (a 3rd pane at the bottom will appear which you can edit)
 
- Now browse your changes ...
 
- ... To remove a change, click the triangle shape on the right side. (shape icon turns blue)
 
- ... To add the change back, click the circle shape on the right side. (shape icon turns green)
 
- Quit the editor and save your changes and your done!
 
Does that help?