从Eclipse本地历史记录直接还原已删除的文件 [英] Restore deleted file directly from Eclipse local history

查看:473
本文介绍了从Eclipse本地历史记录直接还原已删除的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些git错误发生了,我丢失了一个文件的很多变化。我使用Eclipse作为我的IDE,但git的错误包括删除项目并重新克隆目录。所以我无法从Eclipse中恢复。我相信我已经找到包含我要还原的代码的本地历史文件,但我不知道如何cat这个文件。这有点像json。



任何人都知道如何还原或读取.metadata.plugins\org.eclipse.core.resources.history
文件?

解决方案

我能够恢复我的代码。

我去了prj / .metadata / .plugins / org.eclipse.core .resources / .history

然后做了一些冲击:

  fgrep -r -c[一些功能该文件的特定名称]* | grep -v:0| cut -d:-f 1 | xargs ls -l | grepJul 29

所以这是贪婪和计数一些特定于代码的文本的次数我在文件中缺少显示,然后删除计数为0的文件,然后从文件名的末尾删除计数,然后执行文件的详细信息,然后选择搜索特定的日期。因为我正在使用clojure,我注意到有一个文件大小的文件。大文件是REPL的备份,小文件是代码的备份。



+1 for Eclipse:)


Some git mistakes happened and I lost a lot of changes for one file. I was using Eclipse as my IDE but the git mishap included deleting the project and re cloning the directory. So I can't do the restore from within Eclipse. I believe I have found the local history file that contains the code I want to restore but I'm not sure how to cat this file. It kinda looks like a json.

Anyone know how to restore or read the .metadata.plugins\org.eclipse.core.resources.history files?

解决方案

I was able to recover my code.
I went to prj/.metadata/.plugins/org.eclipse.core.resources/.history
Then did some bashing:

fgrep -r -c "[Some function name specific to that file]" * | grep -v ":0" | cut -d : -f 1 | xargs ls -l | grep "Jul 29"

So this is greping and counting the number of times some text specific to the code I'm missing shows up in the files, then removes the files where the count is 0, then removes the count from the end of the file name, then does ls to get details on the files, then optionally search for a specific day. Since I was working with clojure I noticed that there were files that either had a large or small file size. The large files were backups of the REPL, the small files were backups of the code.

+1 for Eclipse :)

这篇关于从Eclipse本地历史记录直接还原已删除的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆