To undo a sort in Google Sheets, press Ctrl+Z on Windows or Chromebook, or Command+Z on Mac, immediately after sorting. You can also choose Edit > Undo. If other changes have happened since the sort, use version history to find an earlier copy; if neither option is available, you will need an existing column or backup that records the original row order. These steps apply to Google Sheets in a web browser.
What You’ll Need
- Access to the Google Sheets file in a browser, with permission to edit if you plan to undo or restore changes.
- The sheet where the sort happened. If you may need version history, it helps to know roughly when the sort was made.
- If undo is no longer available, a previous version, backup, or column that identifies the intended original order. Sheets cannot infer an unknown order from the sorted data alone.
Step-by-Step
- Check whether the sort is the latest action. Look at the sheet and consider whether you made any edits after sorting. If the sort was the most recent change, undo it once. If you have made later edits, undoing once will reverse the latest edit instead, so you may need to undo several actions to reach the sort.
- Undo the sort with the keyboard shortcut. On Windows or Chromebook, press Ctrl+Z. On Mac, press Command+Z. The rows should return to their previous order if the sort is still in the undo history. Check a few identifiable records near the top, middle, and bottom of the data to confirm that the result makes sense.
- Use the menu or toolbar if you prefer. In the Google Sheets menu, choose Edit > Undo. You can also click the Undo icon in the toolbar, which looks like a curved arrow pointing left. These do the same thing as the keyboard shortcut. Do not use your browser’s Back button: it navigates away from the current page rather than reliably undoing a spreadsheet action.
- Undo one action at a time if you edited the sheet afterward. Repeat the undo command and inspect the sheet after each action. Sheets reverses actions in reverse order, so later cell edits, formatting changes, or other actions are undone before the sort. Stop as soon as the rows return to the order you want. If undo starts removing changes you need, use redo immediately (Ctrl+Y on Windows or Chromebook; Command+Y on Mac) or click Edit > Redo, then consider version history instead.
- Check whether you sorted a filter view. If the sorted display is inside a filter view, look for the filter-view bar at the top of the sheet and click its close button, usually marked X, to exit the view. A filter view can show a sorted arrangement for that view without permanently changing the sheet’s normal row order. Reopen the view if needed and check whether its saved sort settings are the source of what you are seeing.
- Look for a reliable original-order key if undo is unavailable. Check for a sequence number, date-and-time field, ID, or other column that genuinely reflects the intended order. If one exists, select the complete data range and sort by that column in the appropriate direction. For example, sort an ascending sequence number from smallest to largest. Do not assume that a customer name, ID, or date represents original entry order unless you know it does.
- Restore an earlier version only if necessary. Choose File > Version history > See version history. In the panel, select a version from before the unwanted sort and inspect its timestamp and contents. If it is the right version, choose Restore this version and confirm. This restores the spreadsheet to that earlier state, not just the row order, so first consider making a copy of the current file with File > Make a copy. Restoring a shared file affects the version everyone sees.
After recovering the order, check that each record’s values still belong together across its row. If the order is important for future work, preserve it with a clearly named sequence column before sorting again.
Common Mistakes
- Sorting only one column in a multi-column table. If you sort a selection containing just one column, names, dates, or amounts can become detached from the other fields in their records. When sorting a table, include all of its related columns and rows so Sheets moves each complete row together. If columns have already been separated, undo immediately rather than trying to match the values by eye.
- Assuming a sort can always be reversed by sorting the opposite way. A to Z followed by Z to A does not recreate the original order when values repeat. Ties may be arranged differently, and the original sequence is not stored in the sort key. An opposite sort only works as a recovery method when you have a separate, dependable key for the prior order.
- Pressing Undo repeatedly without checking. Each press reverses another action. You could remove later edits while trying to get past them to the sort. Undo one action at a time, watch the sheet, and stop when the intended state returns.
- Restoring a version without considering later work. Version history can recover an earlier arrangement, but restoring an older version can also remove edits made after it. Review the version date and make a copy of the current file first if the latest work matters.
- Confusing a filter with a filter view. Sorting from a regular filter menu may rearrange the sheet’s rows. A filter view has its own view controls and can affect only how that view displays the data. Identify which mode you used before attempting a larger recovery.
Tips
- Add an original-order column before sorting. For a one-time task, enter sequence values such as 1, 2, 3, and so on in a new column, then sort the whole table. If you need the original order later, sort by that sequence column. Keep it until you are sure you no longer need it.
- Use a filter view for temporary analysis. Choose Data > Create filter view, then sort or filter while the view is active. This is useful when you want to examine records without changing the normal view for collaborators. Exit the view when finished, and confirm the saved view’s settings if the sorted display returns.
- Confirm the selected range before sorting. Click inside the table and check that Sheets has identified the full data range. If you select a range manually, include all columns that describe each record and ensure that any header row is treated as a header when the sort dialog offers that option.
- Use version history as a safety net, not as the first undo tool. Ctrl+Z or Edit > Undo is faster and targets the recent action. Version history is more appropriate when the undo stack no longer reaches the sort or when you need to inspect an earlier state.
- Tell collaborators before restoring a shared file. A restoration changes the shared spreadsheet for everyone. Let other editors know, and make a copy of the current state if you need to preserve their recent work for later comparison.
Troubleshooting
Undo does not change the row order. The sort may not be the most recent action, or the display may be controlled by a filter view. Check whether undo reversed a later edit; if so, continue cautiously one action at a time. If a filter-view bar is visible, exit that view and check the normal sheet.
The sort is missing from the undo history. Open File > Version history > See version history and look for a saved state from before the sort. If you cannot find a suitable version, look for a sequence field, a source file, or a copy shared by a collaborator. If none exists, there may be no dependable way to reconstruct the exact previous order: sorting changes row order, and Sheets cannot know an order that was not recorded.
Rows appear mismatched after sorting. Stop editing and use Undo immediately. If that does not restore the data, inspect version history and recover a state from before the partial sort. Avoid trying to manually move individual cells; that can create more mismatches. In the future, select the complete table, not just the column used as the sort key.
The restored version is missing newer edits. Version restoration returns the whole file to the selected earlier state. If you already restored it, check version history for the state that existed immediately before restoration and, if necessary, restore that state to get the newer work back. You can then make a copy and compare it with the earlier version to recover what is needed. This is one reason to make a copy before restoring.
A filter view keeps showing the sort. Exit the filter view using its X control, then check the sheet’s normal order. If the same arrangement appears after reopening the view, inspect the view’s sort settings or delete and recreate the view if appropriate. Do not delete a view that collaborators rely on without checking with them first.
Frequently Asked Questions
Can I undo a sort in Google Sheets after closing the file?
Maybe. Reopen the sheet and try Edit > Undo, but the undo history may no longer be available after the session ends. If it is not, use File > Version history > See version history or find a reliable original-order column.
Can I reverse a sort by sorting the column in the opposite direction?
Not reliably. Reversing A to Z to Z to A does not restore the exact previous sequence, especially when values repeat. Use a column that records the original order instead.
Does undoing a sort remove my other changes?
One undo reverses the most recent action. If you made changes after sorting, those changes are undone first. Use Undo one step at a time and stop when the sort is reversed; use Redo if you go too far.
Will restoring version history affect other people?
Yes. Restoring an earlier version changes the shared spreadsheet’s current state for other editors and viewers. Make a copy first and coordinate with collaborators if their newer edits need to be kept.
How can I avoid losing the original order next time?
Add and retain a sequence column before sorting, or use a filter view for a temporary sorted display. A sequence column is the clearest way to return to a known order later.
Related
- Clear Outlook Cache on iOS: Safe Steps That Work
- How to Clear the Recipient Cache in Microsoft Outlook
- How to Clear the Offline Cache in Outlook
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Google Sheets Filter by Date: A Practical GuideYes. In Google Sheets, select your data, choose Data > Create a filter, open the filter dropdown on…
- Compress Photos in PowerPoint to Reduce File SizeTo compress photos in PowerPoint for Microsoft 365 on Windows, select a picture, go to Picture Format >…
- How to Hide Columns in Excel Without Deleting DataTo hide columns in Excel for Microsoft 365 on Windows, select the column letters, right-click the selection, and…
- Out of Office in Outlook for iOS: Set Automatic RepliesTo set an out-of-office reply in Outlook for iOS, open the app’s Settings, select the email account you’ll…
- Excel Double-Click Cell Shortcut: Use F2 to Edit CellsIn Excel for Microsoft 365 on Windows, double-click a cell to edit it in place; the keyboard equivalent…
- How to Add a Comma Between Footnote References in WordTo add a comma between consecutive footnote references in Word, place the insertion point between the two superscript…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.