The Local History feature fills the gap between a full version control system and no version control at all. Every time you make changes to a file and save or build it, the Local History feature will keep a copy of one or more previous saved versions for a predetermined length of time (seven days by default). You will then be able to do a diff comparison between the current version and any past version in its buffer.
The intent of Local History is to keep track of the changes a developer make to a program before having something worthy of committing to the version control system. It is also extremely useful for the independent or small company developer without access to a version control system as it provides similar features. The primary difference is that it only works within the IDE, so it cannot be used to keep track of changes from other team members on other computers. The history is local to the computer on which it was established and will not stay with a project that is moved to another computer. If you need this functionality across multiple systems, a true version control system such as Subversion is a more appropriate mplabx:subversione tool.
Enabling Local History
Local History is enabled by default with a buffer of 7 days. So there is nothing you need to do to take advantage of it immediately.
To disable Local History, set the number of days to keep history to zero.
Adjusting Local History time span
From the main menu, select Tools ▸ Options
Select the Versioning tab.
Select History from the list on the left side.
How to view a file's Local History
In the new tab that opens up in the editor, select the old version you want to compare in the top part of the pane. In the lower half of the pane, the old version will be shown on the left and the current version on the right. The built in diff utility clearly shows you where the files differ and makes it easy to cancel new changes or revert to older code.
How to revert a file or parts of a file to an earlier version
There are three distinct actions you may take in the Local History view to revert the current file to an earlier version.
To remove code that didn't exist in the older file but was added to the current file, click the little red "X" in the margin by the line numbers.
To insert code from an older file into the current file, click on the blue arrow in the margin by the line numbers.
To revert the entire current file to an older version, click on the blue arrow in the middle-top of the diff window.