How to recover the java file code deleted by mistake in eclipse

Recovery of accidentally deleted files

When writing code with eclipse, files or packages are sometimes deleted by mistake. Through eclipse's file recovery function, you can recover files deleted by mistake.

The specific steps are:

1. Select the package (folder) where eclipse is located to delete the file by mistake

2. Right click the package.

3. Select Restore from local history

4. In the pop-up dialog box, select the file to restore

See the figure for details:

Select the file to restore

Code recovery and comparison

1. Select the code snippet to modify the comparison

2. Right click

3. Select local history

4. Select the desired action.

See the figure for details:

The above is to restore files from historical versions. You can see that eclipse has the function of SVN. But sometimes we're not very lucky. Maybe eclipse doesn't record the historical version of the file we mistakenly deleted.

Press Ctrl + Z to restore directly

If the file has just been deleted by mistake, you can also directly select the package where the file is located (the file is deleted) or the upper level of the deleted package (delete package and folder) and directly press Ctrl + Z to restore.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>