帮助! 恢复 Eclipse 文件

发布于 2024-07-16 19:18:36 字数 1459 浏览 11 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

回梦 2024-07-23 19:18:36

有时 Eclipse 会保留对您编辑的文件所做的更改。 并不总是有效,但值得一试:

  • 在(包、项目、导航器)资源管理器中查找文件。
  • 右键单击您的文件并查找要比较的菜单...(我建议比较,但在您的情况下这并不重要,因为文件现在为空)
  • 从子菜单中选择本地历史记录...

如果您幸运并且有如果您一直在使用 Eclipse 编辑该文件,您应该会在其中找到一些条目。 查找它们,您很可能会找到内容。

这帮助了我无数次,也多次救了我的命。 然而,每次我诉诸它时,我总是感觉像用棒球棒敲我的头,因为我没有尽早对源代码控制系统进行更改。

祝你好运,如果这不起作用,我担心 SO 不会对你有太大帮助:-(

--- 编辑 ---
一些小东西可以帮助让这个技巧变得更有用一点。

您可以更改 Eclipse 在本地历史记录中保留的信息量,转到您的首选项,然后常规 -> 工作区 -> 本地历史记录(此处为 Indigo,在其他版本上可能有所不同)。 如果您容易头晕或熬夜太多,这将帮助您在第二天修复您坚持在睡觉前完成的错误修复。

Sometimes Eclipse keeps the changes it made to the files you edit. Does not always work but it's worth a try :

  • Find you file in your (package, project, navigator) explorer.
  • Right click on your file and look for the menus to compare... (I recommend Compare though in your case it will not matter since the file is now empty)
  • Choose Local History... from the sub menu

If you are lucky and had been using Eclipse to edit the file you should find a few entries there. Look them up, chances are you will find the content.

This has helped me countless times and saved my ass on many occasions. However, every times I resort to it I always feel like hitting my head with a baseball bat for not commiting changes to the source control system earlier.

good luck, if that does not work I fear the SO will not be of much help to you :-(

--- EDIT ---
Little something that can help make this trick a tad bit more useful.

you can change the amount of information Eclipse keeps in local history, go to your preferences and then general->Workspace->Local History (Indigo here, may be different on other versions). If you tend to be light headed or burn the midnight oil a bit too much this will help you repair the next day that bug fix you insisted on finishing before going to sleep.

划一舟意中人 2024-07-23 19:18:36

如果您知道文件中的某些短语或不常见单词,则可以在硬盘驱动器的原始扇区中搜索文本片段。 这将在可能写入的任何地方显示文本:作为分页虚拟内存、作为仍然存在的文件(临时文件或保存的文件)、或者作为已删除且空间尚未重写的临时或保存的文件。

但这会很慢。 如果该文件从未写入磁盘,则不会产生任何结果。 它产生的结果可能是支离破碎的或不完整的。

启动 Knoppix CD 并开始 grep! Knoppix 是一个从 CD 运行的 Linux 安装,无需写入硬盘。

如果您有 SCSI 或 SATA 磁盘,则需要使用 /dev/sda 而不是 /dev/hda

另一个答案是正确的,操作系统继续运行的每一刻都会降低您的性能。恢复机会。 拔掉电源并使用另一台计算机来准备 knoppix CD。

If you know some phrase or uncommon word from your file, you can search the raw sectors of the hard drive for pieces of text. This will turn up the text anywhere it might have been written: as paged out virtual memory, as a stil-existant file (temp file or saved file), or as temporary or saved file that was deleted and the space has not yet been rewritten.

But it will be slow. And if the file was never written to disk, it will yield nothing. And what it yields may be fragmented or incomplete.

Boot a Knoppix CD and start grepping! Knoppix is a linux installation that runs from CD, without writing to your hard drive.

If you have SCSI or SATA disks, you need to use /dev/sda instead of /dev/hda

The other answer is correct, every moment that OS continues running decreases your recovery chances. pull the power and use another computer to prepare the knoppix CD.

温馨耳语 2024-07-23 19:18:36

首先,关闭计算机。 此时它打开并使用的每一秒都会减少您恢复文件的机会。

First, turn off the computer. Every second that it is on and being used at this point reduces the chance you'll recover your file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文