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
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
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.