I recently had to backout a submitted changelist (CL#926201) after discovering that there were runtime conflicts with another project.
After backing out the changelist I synced to the changelist which I had previously submitted by using (from the root of my workspace):
p4 sync ...@926201
This downloaded the old revisions of my changed files to the workspace, but did not add them to a pending changelist.
I wanted the files from my original changelist to be added to a new changelist so that I could resubmit them after investigating the issue locally and making any necessary revisions.
I couldn't find any commands which would accomplish this for me, but I did reconcile the changed files in my workspace which were not added to any changelists in my workspace by using (from the root of my workspace):
p4 reconcile
This turned out to be a mistake. The command took about an hour to run, and ended up adding every artifact from every target directory from every project I'd ever run out of that workspace. I ended up with a 52,000 file changelist. Perforce dutifully checked out all of these files from the depot for me which took another hour or so to undo.
At this point I decided to manually add only the files which I'd modified in CL#926201 to the new changelist. This took a while longer, but I eventually got everything to match up with how it was before the original submission of CL#926201.
In case I'd made a mistake in this process I decided to sync with the depot again in order to ensure that the differences were exactly the ones which I wanted to keep. I used IntelliJ for this, which I assume is calling some flavor of p4 sync internally (I do know that the force flag was off since there's an option for this in the IntelliJ GUI). I expected there to be merge conflicts (or whatever Perforce calls them) that would allow me to simply accept all of the local revisions. Unfortunately all of the files in my new changelist were immediately reverted to the backout revision. I suspect that retrieving a particular revision from before had somehow flagged these files as "okay to overwrite these because they're old". I don't know the specifics, but I'm curious to find out.
Now that I was back at square one I decided to give up on using Perforce directly and ended up manually copying all of the file diffs into the existing classes line by line so that they'd look like new changes to Perforce when I eventually went to submit them. This was a tedious process and I felt rather stupid having to do it this way, but it ultimately worked.
Now I'm left wondering how I was supposed to go about this. It seems like a fairly common use case, but I can't find any mention of the correct approach for getting your changes back and resubmitting them after a backout. What should I have done here instead?