How-to Guide: Recover Deleted Files from Eclipse IDE
This article describes 4 effective methods and steps on how to recover deleted files from Eclipse. Scroll down to learn more.
Can you recover deleted files from Eclipse?
“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.
How to Recover Deleted Files from Eclipse
Here are 4 effective methods in the following to recover deleted files from Eclipse.
Way 1: Restore from Local History
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.
Way 1: Recover Deleted Files using Software
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.
❤❤❤ Why Choose AOMEI FastRecovery?
- Two advanced scanning technologies: Perform Quick Scan to scan and recover deleted files in Windows 11 10, 8, 7, and Windows Server easily and quickly, and integrate Deep Scan for a thorough search.
- Recover deleted or lost files, from documents (e.g. recover deleted Word files) to images, audios, videos, compressed files, webpages, etc., more than 1000 data formats.
- Search or filter files and folders quickly and accurately.
- Preview and recover files while scanning, saving your precious time.
- Compatible with including NTFS, FAT32, exFAT, and ReFS file systems.
- Recover data from all types of situations like accidental deletion, formatted disk, system crashes, virus attacks, and more.
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.
Way 3: Recover Deleted Files with Git
If you use Git with Eclipse, you’ve got a safety net. Even without commits, stashes or the Reflog might save you.
From commits:
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.
From stashed change:
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.
From Reflog
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.
- git reflog
- git checkout [commit-hash]-- [file-path]
Way 4: Re-import Deleted Project to Workspace
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.
Closing Words
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.