Stop writing new data to the PC, then search the disk and VS Code’s recent-workspace records before attempting recovery, because continued use can overwrite deleted file data.^1^
GitHub Copilot generates or edits files in the workspace available to VS Code; it should not be treated as a separate backup of the resulting project. Likewise, “no folder open” means VS Code has not reopened the folder—it does not by itself prove the folder was deleted.
1. Locate the original folder
- In VS Code, select File → Open Recent and try every relevant folder or workspace entry. VS Code normally preserves the folder and open-file state of previous sessions.^2^
- Open File Explorer → This PC. Search for:
- A remembered filename, project name, unique asset name, or text fragment.
-
*.html, then *.css, *.js, *.svg, and *.json.
- Assets separately:
*.png, *.jpg, *.jpeg, *.webp, *.gif, *.ico, *.woff, *.woff2, *.ttf, *.mp4.
- For each result, right-click it and select Open file location. Microsoft recommends searching from This PC when the original location is unknown.^3^
- Check these locations manually:
-
C:\Users\<username>\Desktop
-
C:\Users\<username>\Documents
-
C:\Users\<username>\Downloads
-
C:\Users\<username>\source
-
C:\Users\<username>\OneDrive
- Other folders under
C:\Users, in case another Windows profile was used
- Recycle Bin
This PowerShell search is limited to the current Windows user profile, but is often faster for source files:
$types = '*.html','*.css','*.js','*.svg','*.json',
'*.png','*.jpg','*.jpeg','*.webp','*.gif',
'*.ico','*.woff','*.woff2','*.ttf','*.mp4'
Get-ChildItem $env:USERPROFILE -Recurse -Force -File `
-Include $types -ErrorAction SilentlyContinue |
Sort-Object LastWriteTime -Descending |
Select-Object LastWriteTime, FullName
2. Check Git and VS Code recovery data
Search for Git repositories, including hidden .git directories:
Get-ChildItem $env:USERPROFILE -Directory -Recurse -Force `
-Filter '.git' -ErrorAction SilentlyContinue |
ForEach-Object {
[pscustomobject]@{
Repository = $_.Parent.FullName
Modified = $_.LastWriteTime
}
}
For each repository, inspect its log:
Set-Location 'C:\path\to\repository'
git status
git log --all --oneline --decorate
Git can restore committed files and retained Git objects; it does not guarantee recovery of uncommitted working files. VS Code also exposes Git commits and local-save events through a surviving file’s Explorer → Timeline view.^4^
For a standard VS Code installation, make a read-only copy of %APPDATA%\Code\User and inspect these commonly present subdirectories:
-
History — possible local-history entries for saved files.
-
Backups — possible unsaved-editor recovery data.
-
workspaceStorage — workspace metadata that may reveal an original folder path.
Sort their contents by Date modified and inspect metadata or text files for the project name or old path. These locations are implementation-dependent and are not guaranteed full-project backups; Insiders and portable installations use different user-data locations. Official VS Code documentation does not establish workspaceStorage or Open Recent as dependable deleted-project backups.^4^
Removing a folder from a VS Code workspace normally removes the workspace reference; recovery software is needed only if the underlying folder was separately deleted, moved, or lost.
3. Restore an existing backup
If the project was under OneDrive, inspect both the local OneDrive folders and the OneDrive web Recycle Bin/version history. Windows Backup can redirect Desktop, Documents, Pictures, Videos, and Music into OneDrive.^5^
If File History had already been enabled:
- Navigate to the folder that previously contained the project.
- Right-click it → Restore previous versions.
- Open a dated version to verify it.
- Prefer Restore to... and select another folder, avoiding replacement of current data.^6^
4. Recover deleted files
If searches and backups fail, install Windows File Recovery from Microsoft Store and connect an external drive, such as E:. The source and destination must differ. First run winfr /? because supported switches vary by installed version.^1^
For recently deleted files on an NTFS drive:
winfr C: E: /regular /n *.html /n *.css /n *.js /n *.svg /n *.json /n *.png /n *.jpg /n *.webp
If that fails:
winfr C: E: /extensive /n *.html /n *.css /n *.js /n *.svg /n *.json /n *.png /n *.jpg /n *.webp
Some Windows File Recovery versions filter development types such as CSS, JavaScript, and JSON. Check winfr /!; use /e only with a mode for which that installed version explicitly lists /e as supported—do not add it to /regular or /extensive if rejected. Recovered results can be incomplete, especially when deleted space has already been overwritten.
References
- Windows File Recovery | Microsoft Support
- User interface - Visual Studio Code
- Find lost files after upgrading Windows | Microsoft Support
- View source control history - Visual Studio Code
- Backup, restore, and recovery in Windows | Microsoft Support
- Backup and restore with File History | Microsoft Support