Restore deleted Eclipse Project

蹲街弑〆低调 提交于 2019-12-02 14:01:32

问题


I wanted to make a new git repository in eclipse and when I was deleting the old one, unluckily the whole project has been deletet from the workspace!

Is there any way to restore the project?

I would appreciate your answer!!!


回答1:


If you have another repository with your work (like a central git server,another developer, another computer or something like that) you can just clone your repository back from that:

File -> Import -> Projects from Git -> URI ->
Type in your server/the other developers repo and complete the wizard.

And here is the reason why you lost your work:

In order to make git work, egit moves all the project files into the repository (which is only a special directory). Therefore, if you delete the repository, you also delete all the files in it, containing your whole project.


For the future:

To move your repository, just move it to another position using a normal file explorer. After that, tell eclipse about that by removing the repository from the repositories view (NOT deleting it):

In the Repositories View: Right-click on the repository ->
Remove from Repositories View

Then add the repository in its new location:

In the Repositories View: Upper right corner:
Add existing Git Repository to this view



回答2:


A couple of years late, but in case anyone else sees this: You can right click on the project folder and select "Restore From Local History...". With any luck you should be able to restore the lost files from there.



来源:https://stackoverflow.com/questions/18601987/restore-deleted-eclipse-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!