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.
Have Questions? Post them here!
- How to display hidden files in Eclipse (dot prefixed files)
- Convert existing code project into a git project using Eclipse
- How to enable line numbers in Eclipse IDE
- [Eclipse] Syntax error, annotations are only available if source level is 1.5 or greater
- Enable Spellcheck in eclipse workspace
- How to create a Git Project in Eclipse (Step-by-step)
- [Solution] Spring Tool Suite (STS) support for JSP (JAVA EE)
- How to Remove All Terminated Console tabs at once in Eclipse
- Eclipse Java: Multiple markers at this line error
- Compare Current and Previous Versions of Same File (Local History) in Eclipse
- Eclipse : Workspace was written with an older version of the product and will be updated
- How to Save Eclipse console logs in external log file
- Fix: Eclipse Cant Connect to any repository not Authorized Error GitHub
- How to remove unwanted Java imports in IntelliJ (alternative of eclipse Ctrl + Shift + O)
- How to Configure GitHub with Eclipse IDE in 2023
- How to use Content Assist in Eclipse IDE
- Enable Eclipse dark mode
- Fix: Eclipse Connection time out: github.com
- Java was started but returned exit code=13 [Eclipse]
- Java Decompiler Eclipse Plugin
- Add imports in eclipse shortcut key combinations
- Syntax error, parameterized types are only available if source level is 1.5 or greater [Java]
- [Eclipse] Enable or Disable print margin line
- Eclipse Error The JVM Shared Library JavaVirtualMachines does not contain the JNI_CreateJavaVM symbol
- How to reset Eclipse IDE Code Font
- [fix] Java JDBC ConnectException: Connection refused - Java
- How to turn on Bluetooth on Windows 10 - Microsoft
- Android AlertDialog with Yes No and Cancel Button - Android
- Create SharePoint Site Collection using PowerShell New-SPSite - SharePoint
- How to Skip or Ignore JUnit test cases in Java - Java
- [Fix] Microsoft Teams No Network Connection Please check your network settings and try again.  - Teams
- Add Calendar to SharePoint Site (Office 365) - SharePoint
- How to install iTerm2 Mac Terminal Alternative - MacOS