Oops, I just archived a bunch of Gmail messages! How do I get them back to the inbox (bulk unarchive)?

Matthew R. Lee
3 min readSep 22, 2020


How do you undo a mass archive?

Have you ever archived a group of Gmail messages you wish you hadn’t? I recently received this request from a user.

I was sorting my emails, and I selected all of the messages in my inbox. Somehow, I accidentally archived them all. Now, I can see the messages scattered throughout Gmail’s All Mail folder, but how do I find the ones that weren’t archived until yesterday and put them back? Do I have find each message and move it back one-by-one?

If you’re like me, the messages in your inbox are not necessarily the most recent, but they represent the ones you have not read or those that you intend to respond to. I actually had the same problem myself a few years back without finding an elegant solution. When it happened to her and to me, Gmail probably flashed up an undo button in the bottom left, but it was quickly gone.

If you open “All Mail”, the time stamp for each message is the time of arrival, not the date of archival, so everything is mixed up together.

TL;DR: Skip down if you only want the solution.

I knew that Gmail supports significant search criteria, and I expected to find a way to filter by archived date in the search bar, something like “archived_date: 9/22/2020”. I didn’t find any useful search criteria in Gmail or Thunderbird, so I went back to the web.

I found this promising forum article, “How do I undo accidentally mass archived all read emails in inbox by using an unknown shortcut?”

Fist of all, the shortcut for archiving in Gmail is “e”, which was not revealed in the post. Unfortunately, the Recommended Answer can be summarized in 2 words: You can’t!

If you know anything about software forums, the most useful answer is almost never the first or recommended one, so I kept digging. One comment suggested searching for “label:Archive”, which didn’t work in Gmail, as this isn’t the right syntax.

This incomplete solution sent me in the right direction, and eventually I found the solution.

The Solution

  1. Open Gmail and login to your inbox.
  2. In the search box, type “in:archive” (without the quotes) and press enter. It will then show only messages that have been archived (not including messages in the inbox like All Mail).

The magic of this command is that now the dates of the messages represent the date of archival (not the date of receipt)! The results should already be sorted by date that the message was archived, and when you scroll down to the moment of your accidental archival, you should see a whole bunch of consecutive messages. These are the ones you accidentally archived.

3. Use the checkboxes to select the group of messages you want (for example, all messages archived at 3pm yesterday).

A screenshot of a selected email, with the archival date shown.
Selected email, with archival date to the right (not arrival date).

4. Move to > Inbox.

Move to > Inbox.
Move to > Inbox

5. Remember that you may have to deal with several pages of results.

When you return to your inbox, you should see that all of those messages you were still planning to read or handle have returned!

This is my first Medium article. I’m writing it because the post I referenced is locked and I can’t add the solution. I hope this helps someone else!