I had a pending changelist in my wo开发者_开发问答rkspace.
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?
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.
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.
I was also facing the same issue. my workspace over written from cvs by mistake and I lost all the changes in some of my local files.I found that in eclipse UI resource history has shown as blank for the files but the history file created by the eclipse still exist in *$eclipse-workspace.metadata.plugins\org.eclipse.core.resources.history* folder. Use any text editor like notepad++ to search for the name of your file in all the folders and you can easily recover the file from there. I just did the same to recover my files.
If Visual studio is the IDE undo under edit menu recovers the files
Drive snapshots are your best bet to prevent this in the future. For my personal non important projects, I use a Git for checkins; but dropbox for easy multi-machine work and snapshotting of non checked in code (even to local repo)
The only solution is having backups/snapshots. If you're in a corporate environment, contact your IT department.
If you are in a unix corporate environment, you might have a ~/.snapshot directory that keeps hourly snapshots of all your files for the last few days.
精彩评论