Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need to recover local changes overwritten by p4 revert

Tags:

perforce

I had a pending changelist in my workspace.
By mistake I reverted one of the files by reverting to depot. Eclipse wiped off the local history. I am not sure if perforce keeps any history for pending changelists.

Is it possible to recover such file?

like image 508
Nayn Avatar asked Dec 06 '22 02:12

Nayn


2 Answers

The simple answer (to my knowledge) is "no". Perforce doesn't keep a history for (non-submitted) changelists.
Unless you happen to be on an operating system that offers snapshots (or your file-server does), you are out of luck.

like image 146
jhwist Avatar answered Dec 18 '22 12:12

jhwist


Another thing you might try for the future is to get in the habit (e.g., by defining a local alias) of always using 'p4 revert -a'. It would be nice if 'p4 revert -a' had been the default, and you had needed to pass a special flag to indicate that you wanted to revert a file that you had locally changed, but that's not the way it currently is, unfortunately.

like image 44
Bryan Pendleton Avatar answered Dec 18 '22 12:12

Bryan Pendleton