Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top