1

I have submitted one file in perforce, and changes submitted by other user got reverted in merge.

Changes were not conflicting.

Is their a way, I can get that user's changes back. Means revert the revert.

Also how to submit a changelist again with new changelist number?

1 Answers1

6

In order to revert a file (fall back to its previous version) you simply sync the previous version and submit that again. For a single file the procedure goes like this:

# sync file at old revision (#3 in this example)
p4 sync //depot/file#3    

# mark the file for edit
p4 edit //depot/file

# make perforce aware that something has to be merged
p4 sync //depot/file

# resolve (i.e. throw away the head revision changes and save those from #3)
p4 resolve -ay

p4 submit

If you have a changelist with several files (and not only edits, but also deletes & adds) the rollback is a bit more difficult. See also this question.
Here's a smart script for that purpose and more info.

The 2nd part of your question I did not understand. Submitting a change again with a new changelist number doesn't make sense, since a changelist contains diffs. If it was submitted once, then the diffs are already in the depot, so you can't submit the same diffs again.

Community
  • 1
  • 1
pitseeker
  • 2,535
  • 1
  • 27
  • 33
  • +1. Answer looks perfect although I haven't tried. Also there's one more [question](http://stackoverflow.com/questions/3015062/reapplying-changelist-in-perforce) I found, which is kind of similar. –  Oct 17 '12 at 12:02
  • I actually meant in 2nd part that as changes don't conflict, Can I submit that old changelist as new (as if I am submitting new changes) –  Oct 17 '12 at 12:04
  • A once submitted changelist cannot be resubmitted. Also the diffs cannot be changed anymore. You can change the description though: "p4 change -u ". – pitseeker Oct 18 '12 at 07:53