Restore deleted Eclipse Project

后端 未结 2 1765
南笙
南笙 2021-01-24 18:19

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 t

相关标签:
2条回答
  • 2021-01-24 18:57

    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
    
    0 讨论(0)
  • 2021-01-24 19:00

    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.

    0 讨论(0)
提交回复
热议问题