Eclipse本身会将Java文件还原为旧版本吗

Eclipse本身会将Java文件还原为旧版本吗

本文介绍了Eclipse本身会将Java文件还原为旧版本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是怎么发生的,但是在重构了变量名(最终的静态int)之后,该文件显示了同一文件的更早版本,无法恢复所有时间.我投入的工作.

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)?

有人经历过吗?

这是Eclipse的众所周知的行为吗?

Is this a well known behavior of Eclipse?

推荐答案

从本地历史记录中恢复工作

尝试使用Eclipse的本地历史记录"功能来恢复丢失的工作.

Recovering work from Local History

Try recovering the lost work by using the 'Local History' feature of Eclipse.

右键单击一个文件,然后单击 Compare With->本地历史记录... 就像这样:

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.

有关更多详细信息,请参见 Eclipse帮助页面.

For more details see this Eclipse help page.

此功能对于重新开始工作可能会非常有用,否则可能会丢失工作.为了增加每个文件的历史记录数量(每个文件的最大条目数)和此历史记录的寿命(保存文件的天数),请尝试通过以下方法增加默认值:到 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 to Preferences -> Workspace -> Local History :

这篇关于Eclipse本身会将Java文件还原为旧版本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 07:52