My company has a policy about keeping source code encrypted on local developer machines. Where does IntelliJ IDEA keep the copy of the code changes that is used to drive its local history feature?
With IntelliJ IDEA you can restore that change in a couple of clicks. Right-click anywhere in the editor and choose Local History | Show History from the context menu. In the dialog that opens, the left-hand pane shows a list of all saved revisions of the current file with timestamps.
From the main menu, select File | Invalidate Caches. In the Invalidate Caches dialog, you can select additional actions that the IDE will perform while removing the cache files: Clear file system cache and Local History: remove the virtual file system cache together with the information stored in Local History.
Project settings are stored in the project directory as a set of XML files under the . idea folder.
Local changes tab ( View | Tool Windows | Version Control - Local Changes ), default shortcut is Alt + 9 .
(Answer updated to show new locations as they changed in v2020.1)
They are stored in ${idea.system.path}/LocalHistory/
. See the Directories used by the IDE page in the user guide (and this legacy IDEA document) for the location of the IntelliJ IDEA idea.system.path
directory on various platforms. The default locations changed in 2020.1. See the above guide for info if using an older version. Also note the locations can change based on overrides you may have made.
The defaults for the system
directory for 2020.1 and later are:
%LOCALAPPDATA%\JetBrains\<product><version>
C:\Users\Snoopy\AppData\Local\JetBrains\IntelliJIdea2020.1
~/Library/Caches/JetBrains/<product><version>
~/Library/Caches/JetBrains/IntelliJIdea2020.1
~/.cache/JetBrains/<product><version>
~/.cache/JetBrains/IntelliJIdea2022.1
As a side note, if you want to turn local history off, you can do so in the maintenance registry. On Windows/Linux, you can access it via Ctrl+Alt+Shift+/, or Cmd+Opt+Shift+/ on Mac. Select "Registry" from the popup. In the registry dialog, find the entry localHistory.daysToKeep
and set it to zero. (I've never actually tried setting it to zero, but I am assuming it would work for you.)
After the information provided by Javaru. For example, PyCharm saves the Local History at:
~/Library/Caches/PyCharm2017.1/LocalHistory
More information: Project and IDE Settings, Directories used by the IDE to store settings, caches, plugins and logs
On my Windows machine, local history is kept in this folder:
C:\Users\hp\AppData\Local\JetBrains\IntelliJIdea2020.3\LocalHistory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With