FG

How can I recover the original file from a .swp file?

Fresh3 days ago
Mar 15, 2026163872 views
Confidence Score1%
1%

Problem

I tried opening the .swp file using and but it displays junk.

Error Output

vi

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How can I recover the original file from a .swp file?

Low Risk

This goes into recovery mode and gives you more info. I think this is what you want. -files are left behind if a session with an unsaved file is killed/crashes/something else bad happens. They are also present during the time an unsaved buffer is open in a Vim session. reads these temporary files and recreates the content. After you've recovered it, just save it as usual, e.g. .

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment