The other day I was working on my project. I had cygwin open and copied a file to another so I could use it as a template. Unfortunately, I typed the wrong name and overwrote an existing file that I had local modifications in. Because of the local modifications, couldn’t just get it back from source control. So, how could I the contents of the file back?
Since the file was in eclipse, I refreshed the project, then right clicked on the file. Select “Compare To” and “Local History”. I selected a time previous to when I had copied the file over my existing file. The previous revision is on the right side of the comparison, and my new, incorrect stuff is on the left. I was then able to select all on the right and copy it into where it ought to be.
Since that time I have learned that you can right click the file in the Package Explorer, select Replace With, and Local History or Previous from Local History and you can select a previous version and replace the file rather than having to select the contents and paste.
This also works if you delete a file, even if you delete it within eclipse. Simply create a new file of the same name, refresh the project to get the new file, and compare to local history.