Looking to restore Sublime Text files? That doesn’t surprise us, since these files, belonging to the source file text editor software, are pivotal to programmers. Moreover, since the program is suitable for markup and programming languages and permits adding plugins to bolster its functionality and features, it has a wide variety of uses. Another thing that makes it so useful is that it’s a cross-platform software, meaning Windows, Linux, and Mac users can all share knowledge. Simultaneously, programmers can check the way their project looks and work on all platforms and even effortlessly switch from one operating system to another. With that in mind, we will teach you how to recover Sublime Text files.
1. Recover Sublime Text files from cache and data directory
Sublime Text relies on data and cache directories on your computer, whether Mac, Windows, or Linux. These files can be compatible across platforms, or can at least be opened in a text editor and data extracted manually. These locations are unchanged through major versions, making it easy to locate them. Before doing anything, exit the software. Now, go to these locations to find Sublime Text data or make a backup:
- Windows — %APPDATA%\Sublime Text 3 or C:\Users\<user profile name\AppData\Roaming\Sublime Text 3
- Linux — ~/.config/sublime-text-3
- Mac — ~/Library/Application Support/Sublime Text 3
- Portable version — <installation folder>\Data\Local\
Folder names may be Sublime Text or sublime-text if you are using a version of the software before 3.0. Also, keep in mind that the Library folder on Mac may be hidden. The quickest way to open it is using the Finder in the top menu, then selecting Go → Go to Folder → Type ~/Library.
In all cases, if you made a backup of that folder, copy the current one to a safe location. Then, copy the backup folder, so it takes its place. Optionally, replace the cache folder below if you have a backup. Otherwise, copy this folder for safekeeping, and use it as a future backup. After doing that, check if you see a Session.sublime_session file inside a Local folder, which is where the crucial data is. If you only see one, that’s the latest state of the software, i.e., useless if you opened the software and noticed data loss.
However, software oftentimes saves the second to last version as a slightly different name, such as Session.sublime_session-. If that’s the case, you can rename the current file to, say, Session.sublime_session-old, then remove the addition to the old one (in our case, dash or -) so it gets the original name. Open the software and the old data should be back. If it isn’t, use the Browse Packages command from the palette, then select the file.
Where to find Sublime Text cache files?
You can’t accomplish a lot with cache alone, but it can make a difference in restoring your projects and software settings. Here are the file paths for cache that Sublime Text software uses:
- Linux — ~/.cache/sublime-text
- Windows — %LOCALAPPDATA%\Sublime Text for Sublime Text 4.0 and later, LOCALAPPDATA%\Sublime Text 3 for Sublime 3.0, 3.1, and 3.2
- Mac — ~/Library/Caches/Sublime Text
- Portable version — <installation folder>\Caches or <installation folder>\Data\Caches
Like above, if you have a backup prepared, make a copy of the current one and store it safely. Then, replace it with the backup folder. Else, this will be the backup for future problems.
2. Download Sublime Text files from a local or cloud backup (Situational)
Sublime Text lets you add a plugin to sync data to a cloud backup service such as Dropbox and iCloud (mere examples). That means all your work is safely stored on a remote server and all you need is to reinstall the plugin, login, and request the data. Moreover, nifty developers have created tools that automatically make a copy of the files we mentioned in method 1, and sort them by date and time. Additionally, every operating system provides an option to go back to an earlier version. For instance, Mac users can use Time Machine while Windows users can employ System Restore and Windows File Recovery.
It’s time-consuming to demonstrate all options, and we have no affiliation with any third-party tools. Plus, we demonstrated restoration of overwritten files on Mac, and Time Machine is only the first method. On the same note, we taught you to recover data via Windows File Recovery and explained the tool. We also have Linux-based data rescue guides if that’s what you seek.
3. Use data restoration software to scan for Sublime Text files
If you never made a manual backup, took no precautions to link your software to an external cloud service, and Time Machine and WFR produced no results, you surely feel defeated. Luckily, that’s where data recovery software comes in. You’ll find plenty of effective, reputable software in our “Best” category, available for all platforms Sublime Text supports. Always double-check its standing and reviews, and whether they let you restore data free of charge. They all work similarly, so here are general steps to recover Sublime Text files via data recovery software:
- Download, install and run the data rescue software you chose. Ideally, perform the download and installation on a separate hard drive, so you don’t overwrite the file.
- Open the software opens, select whether you want to scan the entire drive or only the partition or even a specific folder we mentioned in the first method.
- If offered, pick Deep Scan over Quick Scan. Click Scan or Search for data otherwise.
- Wait for the scan to finish. Look through the files and select them, usually by placing a checkmark.
- Click the Recover button, link, or option.
- Pick a location where files should be restored. You can now import them in Sublime Text or copy them to the aforementioned folders.