Need to restore local changes overwritten by p4 revert

I had a pending changelog in my workspace.
I returned one of the files by mistake when I returned to the depot. The eclipse destroyed local history. I'm not sure if perforce keeps history for pending changelists.

Can such a file be restored?

+2


a source to share


6 answers


The simple answer (as far as I know) is no. Perforce does not keep history for (not submitted) changelists.
Unless you're on an operating system that offers snapshots (or your file server), you're out of luck.



+6


a source


Another thing you can try in the future is to get in the habit (by defining a local alias for example) by always using 'p4 revert -a'. It would be nice if "p4 revert -a" was the default and you had to pass a special flag to indicate that you want to revert the file you modified locally, but that's not the case now, unfortunately.



+2


a source


I faced the same problem too. my workspace was misspelled and I lost all changes to some of my local files. I found that eclipse's UI resource history shows as empty for files, but the history file eclipse generated still exists at * $ eclipse -workspace.metadata.plugins \ org.eclipse.core.resources.history *. Use any text editor like notepad ++ to search all folders for your file name and you can easily recover the file from there. I just did the same to recover my files.

+1


a source


Drive snapshots are the best way to prevent this from happening in the future. For my personal non-important projects, I use Git for checks; but dropbox for easy cross-machine work and snapshot of unregistered code (even for local repo)

0


a source


The only solution has backups / snapshots. If you are in a corporate environment, contact your IT department.

If you're in a corporate unix environment, you might have a ~ / .snapshot directory that stores hourly snapshots of all your files from the last few days.

0


a source


If Visual Studio is the IDE debugger in the edit menu, restore files

0


a source







All Articles