Eclipse is an IDE that is most popular among software engineers for doing their day-to-day coding, a developer spends most of the time writing code, and it's a natural practice to save the changes of a file whenever you hit a milestone, but many times, you feel like you did something wrong and want to go back to the previous versions.
Undo and Redo actions work, but what if you realized that you need to revert code changes that were made two days back? Well here is where Eclipse History comes in quite handy.
Most of the recent changes are saved as version history by Eclipse which you can revert back or compare at any point in time.
Compare File with its Previous Saved History
- Be on the file window which you want to compare the previous versions
- Now right-click on the file and select: Compare With -> Local History...
- Now you should see History View of the File with Revision Times.
- Select the revision date and time which you want to compare with the current version of the file.
- This will open up a window that compares the two versions Local vs Local History where you can see differences in the same file over time.
As you may see in the above screenshot, we have compared the local history of HelloWorld.java file with its local history that you can see on the right side with the file save time stamp.
Useful Tip: Always commit your code to a repository like Git/SVN to make sure you do not lose your file version history.
Facing issues? Have Questions? Post them here! I am happy to answer!
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
- How to show console in Eclipse IDE
- How to Configure GitHub with Eclipse IDE in 2023
- Fix: Eclipse Connection time out: github.com
- Java was started but returned exit code=13 [Eclipse]
- [Fix] Spring Tool Suite STS Code Autocomplete not working with Eclipse
- [Eclipse] Enable or Disable print margin line
- Eclipse Java: Multiple markers at this line error
- Java Decompiler Eclipse Plugin
- Compare Current and Previous Versions of Same File (Local History) in Eclipse
- Eclipse Error : The Eclipse executable launcher was unable to locate its companion shared library.
- Word-wrap Eclipse Console logs
- eclipse maven m2e : Cannot complete the install
- How to Save Eclipse console logs in external log file
- List of Code Snippets/Templates to Eclipse IDE
- How to Access Terminal (Command Line) in Eclipse IDE
- Installing JD Decompiler plugin in Eclipse IDE
- How to Reset Eclipse Theme to Classic
- Increase Font Size of Eclipse Java Code
- Eclipse: Updating Maven Project. Unsupported IClasspathEntry kind=4
- INVALID FILE NAME: MUST CONTAIN ONLY [a-z0-9_.] Android Eclipse Error
- Fix: Eclipse Cant Connect to any repository not Authorized Error GitHub
- [Eclipse] Syntax error, annotations are only available if source level is 1.5 or greater
- Add imports in eclipse shortcut key combinations
- Eclipse version 32-bit or 64-bit check on macOS
- How to create a Git Project in Eclipse (Step-by-step)
- JavaScript: Convert an Image into Base64 String - JavaScript
- [fix] Java JDBC ConnectException: Connection refused - Java
- Step by Step: Spring Boot + JPA + MySQL + Redis as Cache - Java
- Android : Error in http connection java.net.SocketException: Permission denied - Android
- Fix: Microsoft Excel Quit Unexpectedly on Mac - MacOS
- How to identify installed Java (JDK) Version on macOS - MacOS
- Cannot create new Microsoft Team using PowerShell, even as Admin - Teams
- Fix :wq! Vi Error - E32: No file name (when write and quit) - vi