Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij deleted my project files - how to recover?

I was working on a project in Intellij when my laptop suddenly turned off completely(I unplugged the charger and apparently the battery loses contact if you move the computer). I'm sure I saved before unplugging. Now that I launch Intellij, I noticed several unpleasant changes:

  1. The IDE doesn't remember recent projects; it didn't open my project straight up after I launched it as it usually did before.

  2. Project files are all gone, all that remains is an .iml file.

  3. The color theme changed back to white, even though I switched it to black.

  4. Most disturbingly, local history appears to be wiped, there's nothing there save for the .iml file.

In the light of these circumstances, I have these questions:

  1. What the hell happened? Why did all my files disappear? They were all saved, so how could they just vanish?

  2. Is there any way to recover them or did Intellij scrapped them so thoroughly they're gone?

like image 869
Sargon1 Avatar asked Dec 18 '15 05:12

Sargon1


2 Answers

Right click on the project directory or folder. Go to Local_History > Show_History

From the list of history, Right click on the change you want to recover and choose Revert

like image 191
zaman sakib Avatar answered Sep 28 '22 16:09

zaman sakib


It appears that one or more of the IntelliJ project files was corrupted during the sudden power off. As a result, IntelliJ is not loading your project correctly. I would approach this by creating a new project, with the same options as your first one, and then copying the source files over from the old location.

like image 42
Tim Biegeleisen Avatar answered Sep 28 '22 14:09

Tim Biegeleisen