IntelliJ Local History as a VCS-independent safety net
IntelliJ IDEA’s Local History provides a VCS-independent timeline of file saves. Learn how to inspect it, selectively merge changes, recover deleted files, and understand its retention and machine-local limits.
25 Jan 2026, 18:15 UTC

You finish a refactor, run the tests, and nothing works. The last commit is two hours old and you never stashed the half-done changes. With Git you have nothing to go back to. That is the exact gap IntelliJ IDEA’s Local History is built to cover: an IDE-level timeline of file edits that exists whether or not the project is under version control.
The useful takeaway is not to treat Local History as a backup. It is a short-term, machine-local undo buffer with a UI for selective recovery. It helps when you need a quick revert, a surgical merge of a block, or recovery of an accidentally deleted file, without touching VCS.
What Local History actually records
Local History tracks saves made inside the IDE. Each time a file is written, IntelliJ stores a snapshot in the IDE configuration directory, not in the project folder. The history is per-file and per-folder, and it survives IDE restarts because the data lives under the user’s config storage.
Because the snapshots are IDE-generated, they are independent of Git, SVN, or Mercurial. A file that is untracked, a scratch file, or a file in a repo you have not committed yet still accumulates history.
To inspect it, open the Project view, right-click a file or folder and choose Local History → Show History. The timeline shows timestamps and the operation type, e.g., save, rename, delete. Selecting an entry opens a diff view against the current state.
Selective recovery without a full revert
The most practical operation is selective merging. Instead of restoring an entire file to an older state, you can apply only the parts you need.
A common workflow is:
- Open the file in the editor and invoke Local History → Show History from the context menu.
- Pick a prior timestamp and click Compare.
- In the diff view, use the “Merge” or “Copy” actions on specific hunks to bring back a method or block while keeping later edits.
This avoids the all-or-nothing revert that Git checkout would force when you have uncommitted changes you want to keep.
Recovery of deleted items works at the folder level. Right-click the parent directory, open Local History → Show History, and look for a deletion event. Restoring recreates the file or folder from the stored snapshot. The operation overwrites the current workspace state, so check the diff before confirming.
Configuration and limits you should know
Local History is local to the machine and tied to the IDE configuration directory. If you delete or move the config folder, reinstall the IDE on a different machine, or work on a fresh checkout without the history, the timeline is gone. It is not portable with the project.
Retention is configurable. In Settings → Appearance & Behavior → System Settings → Local History you can set how long snapshots are kept. Older entries are purged automatically to bound disk usage. That means Local History is a short-term safety net, not long-term archival.
Granularity varies by file type. Text source files get fine-grained diffs. Large binary files are handled with less granularity and can consume more space, so the IDE may skip detailed tracking for them.
A practical way to verify the feature is working: modify a file, save, then open Local History → Show History and confirm a new entry appears. Delete a test file and restore it via the parent folder’s history to confirm the restore path.
When to use it and when not to
Use Local History for quick, local mistakes: accidental edits, exploratory refactors you did not commit, or recovering a file you deleted in the IDE. It is also useful for comparing two points in time without creating a temporary branch.
Do not rely on it for collaboration, disaster recovery, or compliance. It does not replicate to remote, it is not shared across teammates, and it can be lost with config changes. For durable history, commit to a VCS and push.
Keep the workflow tight: commit often, use Local History as the immediate undo layer, and treat any restore as a deliberate overwrite with a diff check first.