Our Helproom Editor explains how to recover emails you accidentally deleted.

QUESTION I've inadvertently deleted my latest emails. I cleared out Mozilla Thunderbird's Archives folder, without realising this would also delete the same messages in my inbox. Is it possible to recover the deleted messages? See also: Thunderbird update deletes messages and Thunderbird Tip: Show Only Unread Messages.

HELPROOM ANSWER It's usually possible to retrieve messages after an accidental deletion such as this.

First, check the Deleted folder. This functions much like Windows' Recycle Bin in that you can retrieve any accidentally deleted items simply by dragging them to your inbox. You may have more than one Deleted folder, depending on how your email is set up. You could have one residing on your local hard drive and another on your email server. Check both.

If you've already emptied the Deleted folder(s), you may still be able to retrieve some or all of your messages, provided that you haven't compacted your mail database. Although Thunderbird automatically compacts the database under some circumstances, it's worth checking.

Before you do so, note that the service provider may have a backup of your messages if your email is hosted on a server; check with the support team. If no backup is available, you'll have to perform some data recovery yourself.

Open Account Settings and select the account from which the messages were deleted. Now choose Server Settings and find the Local directory at the bottom right.

The folder here should contain your messages. If no folder is visible, open a Windows Explorer dialog, press Alt to bring up the menu, then choose Tools, Folder Options and select the View tab. Enable ‘Show hidden files, folders and drives'.

With the folder now visible, search its contents for an Inbox file. You may also see a file labelled Inbox.msf, but we want the file simply called Inbox. Windows may be configured to hide file extensions, causing these files to look the same.

You can find the correct file by right-clicking each and selecting Properties; the one that has File rather than MSF File in the ‘Type of file' field is the correct file.

Close Thunderbird and make a backup copy of your Inbox file. This is important: you will need to edit the file to restore your messages, which increases the risk of data corruption. If you make a mistake you'll also need to restore the original file.

Next, open the Inbox file in a text editor. Windows' Notepad utility will almost certainly be unable to cope with a file as large as your inbox; instead, you could try the 30-day trial of UltraEdit, available from ultraedit.com. Whichever text editor you use, note that the sheer amount of data inside means it may take a while to open.

Search for one of your missing messages using the text editor's ‘Find and replace' function. This will be easier if you know the message sender. The email header will begin ‘X:Mozilla:Status:', followed by some numbers. Edit these numbers to read 0000, save your Inbox file, and the message will appear marked as unread the next time Thunderbird launches. Follow this step for each message you want to restore.

If you make a mistake or the data becomes corrupt, you can simply write over the Inbox file with the backup copy you saved earlier and start again.

See all How to articles. Get free tech support in the Helproom Forum.

Visit Windows 7 Advisor for more Windows advice. Or email our Helproom Editor for bespoke advice.