I have no idea how this happened but right after re-factoring a variable name (a final static int), the file showed a much earlier version of the same file without any ability to restore back all the hours of work I put in.
This looks like a bug to me or... "undocumented feature" (i.e. unfortunate key-combination that erases hours of work, even if stored on file)?
Has anyone experienced this?
Is this a well known behavior of Eclipse?
Recovering work from Local History
Try recovering the lost work by using the 'Local History' feature of Eclipse.
Right click on a file and click on
Compare With -> Local History...
like so :Once you do that, you should see a History view with timestamped entries like so :
Double clicking on those should allow you to go to a specific version of the File. You should be able to recover your work if you go to timestamped entry just before the apocalyptic refactoring.
For more details see this Eclipse help page.
Local History Preferences
This feature can be most useful to get back work which otherwise would be lost. In order to increase the amount of history per file (
Maximum Entries per file
) and the longevity of this history (Days to keep Files
), try increasing the default values by going toPreferences -> Workspace -> Local History
: