This article describes 4 effective methods and steps on how to recover deleted files from Eclipse. Scroll down to learn more.
“hi, I am working on a web-project using Eclipse IDE and Glassfish application server. Unfortunately, I deleted some servlet files from Elipse IDE. Now I want those servlet files back, please help...!!!Thanks in advance.”
As a popular open-source community, Eclipse integrates different tools, projects, and collaborative working groups, attracting a large number of loyal users who spend a lot of time working on it.
However, due to accidental deletion, Eclipse crashes, workspace corruption, Git Mishaps, etc., you may lose files (e.g. java files), projects, resources, etc. It’s frustrating. Don’t worry about much and there are 4 effective methods to recover deleted files, projects, resources, etc., from Eclipse.
Here are 4 effective methods in the following to recover deleted files from Eclipse.
Eclipse provides users with the “Restore from Local History” feature to restore deleted files from Eclipse. It even allows you to select the last state or any other state for recovery.
Step 1. Select the folder or project containing deleted files from Eclipse IDE.
Step 2. Right-click it and select Restore from Local History. It will display all file versions with timestamps.
Step 3. Select deleted files from Eclipse and click Restore. You can also click Compare With to preview the differences between file versions.
Local History only saves 7 days of files by default. You can adjust the retention time under Preferences > Local History.
Local History only tracks changes made within Eclipse.
If you can’t restore files from Version History, it’s suggested to try 3rd-party data recovery software - AOMEI FastRecovery to recover deleted files from Eclipse in 3 easy steps, whether it’s on the computer, external hard drives, USB drives, or SD cards.
Here is a 5-step guideline to recover deleted files from eclipse:
Step 1. Select the drive to scan
Download and install AOMEI FastRecovery to get started. You’ll be prompted to select the drive where your files were lost. Select it and click the Scan button. If it’s on external hard drive, USB drive, or SD card, please connect it to the computer first.
Step 2. Scan for recoverable data
It will automatically scan the drive for any deleted or lost files. By default, in this situation, it uses the Quick Scan mode, which works fast. So you won’t have to wait too long. It can find files not deleted from Recycle Bin.
Step 3. Find files deleted from Eclipse quickly
It has 3 options to find deleted files from Eclipse, namely, using the search box, file filters, or sidebar directories. Among them, the fastest and easiest one is to type the file name or extension in the search box to search for files and preview them in a clear thumbnail.
Step 4 (optionally): Search the disk thoroughly
If you can’t find the deleted files, click Deep Scan in the lower left corner. It will scan every sector of the disk to find files buried deeper in the file system. You can also use the search box or filter feature to find files quickly.
Step 5: Recover and save your files
Once found, you can select the desired files and click the “Recover” button without waiting for the final result. Choose a different location to save the recovered file, ensuring you don't overwrite any important files.
If you use Git with Eclipse, you’ve got a safety net. Even without commits, stashes or the Reflog might save you.
Step 1. Go to Window > Show View > Git Repositories and click the "Add an existing local repository" button (folder icon) to link your project’s .git folder.
Step 2. Right-click the project and select Show in History.
Step 3. In the History tab, find the commit where the files existed. Right-click them (while holding Ctrl) and select Checkout or Revert Changes to restore it to your workspace.
Step 1. Right-click a project >Team >Show in Git Staging to access Git Staging View.
Step 2. Check the Unstaged Changes section to find the files marked with a red “D” icon.
Step 2. Right-click the deleted files and select “Replace with HEAD Revision or Checkout to restore files to your Eclipse project.
Step 1. Go to Window > Show View > Terminal to open it in Eclipse.
Step 2. Type the following commands and press Enter to restore a specific file from a previous commit. Please replace the commit hash and file path with the corresponding one.
Workspace corruption is one of the main cause for lost files in Eclipse. You can choose to reset Workspace settings and re-import deleted project.
Step 1. Close Eclipse.
Step 2. Navigate to your workspace folder and delete the .metadata directory (backup first!).
Step 3. Open Eclipse. Then, click File > Import > Existing Projects to import deleted projects to workspace.
You can easily recover deleted files from Eclipse in 4 effective methods. Among them, the easiest method is to restore from local history if the files are deleted within 7 days. If not, you still can try 3rd-party data recovery software AOMEI Fast Recovery, Git, or import deleted Projects to workspace.