Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Local History FilesNew to Visual Studio Code? Get it now.
Local History Files

Local History Files

Victoryan

| (0) | Free
Local File Version History
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Local History Files for VS Code

Overview

Local History Files is a Visual Studio Code extension that automatically creates local backups of your files.
Every time you save a file, or even delete it, a copy is stored in a special hidden folder inside your project.
This allows you to recover deleted files or roll back to a previous version without relying on Git or external version control.


✨ Features

  • 📂 Automatic file history

    • A snapshot is saved on every file save.
    • A snapshot is saved when a file is deleted.
  • 🗂 Project-based storage

    • All versions are stored locally in the .history-files folder inside your project.
    • The folder structure mirrors your project’s layout, making it easy to find files.
  • 🗑 Safe from Git

    • Add .history-files to .gitignore so history does not pollute your repository.
  • ⚙️ Configurable history size

    • By default, up to 30 versions per file are kept.
    • You can change this limit in the extension settings.
  • 🔍 Tree view in Explorer

    • Browse and compare file versions directly from a dedicated tree view.
    • Restore deleted files or clean up old history entries with one click.

🚀 Installation

  1. Install the extension from the VS Code Marketplace (link will be added when published).
  2. Restart VS Code.
  3. A new view “Local History Files” will appear in the Explorer sidebar.

🛠 Usage

  • Save a file → a new history entry is created automatically.
  • Delete a file → a copy is kept in .history-files so it can be restored later.
  • Right-click on a history entry → compare with the original file or restore it.
  • Clean history → manually remove deleted entries or configure auto-cleanup rules.

⚙️ Configuration

You can adjust settings in settings.json:

{
  // Maximum number of history versions per file
  "localHistoryFiles.maxEntries": 30
}
Future options may include:

Retention time in days

Excluded file patterns

📌 Important Notes
All history is stored locally only.

History files can grow in size over time — use the cleanup action or adjust settings if needed.

Recommended: add the following line to your project’s .gitignore:

bash
Copy code
/.history-files
💡 Why use Local History Files?
Recover lost work even if you forgot to commit to Git.

Restore accidentally deleted files.

Keep a lightweight backup of changes between Git commits.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft