An easy-to-follow guide to revert changes and undo actions in Google Colab

Did you accidentally delete a cell in Google Colab that contained important code? Or was an earlier version more like what you wanted? This wikiHow article teaches you how to undo a cell change, restore deleted cells using quick keyboard shortcuts, and how to revert your workbook back to a previous version in Google Colab. Colab keyboard shortcuts are different than those used in Jupyter notebooks, but we'll show you the right way to use them.

Things You Should Know

  • To undo a deleted cell on Windows, press "Ctrl + M" and press "Z."
  • To undo a deleted cell on Mac, press "Cmd + M" and press "Z."
  • If you want to restore a previous version of the Colab, go to "File > Revision History > ⋮ > Restore revision."
Section 1 of 3:

Using a Keyboard Shortcut

  1. To undo the last action inside of a cell, you can use the shortcut Ctrl+M+Z (PC) or Cmd+M+Z (Mac). This quick keyboard shortcut will undo the last action, such as restoring the content of a cell you deleted.
    • To undo with the shortcut on Windows, press Control + M + Z at the same time.
    • To use the shortcut on a Mac, press Command + M + Z at the same time.
    • To redo your last undo, use Control + Shift + Y (PC) or Command + Shift + Y (Mac).[1]
  2. Advertisement
Section 2 of 3:

Using the Edit Menu

  1. Click the Edit menu and select the Undo option. You'll see this menu at the top of Colab. The name of the Undo option will vary depending on the type of change you want to undo.
    • For example, if your last action was converting a cell, you'll see Undo cell conversion. If the last thing you did was delete a cell, you'll see Undo delete cell.
    • To redo, click the Edit menu and select Redo.
Section 3 of 3:

Revert to a Previous Version

  1. 1
    Click the File menu. You'll see this above your document space at the top of Colab.
  2. 2
    Click Revision History. It's near the bottom of the menu and will prompt a new window to open.
  3. 3
    Click the versions to see them. Click the version on the right side of the page and it will display on the left.
  4. 4
    Click next to the version you want to revert to. This three-dot menu icon is to the right of the version's name and time stamp.
  5. 5
    Click Restore revision. That version will be restored!
  6. Advertisement

About This Article

Darlene Antonelli, MA
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Darlene Antonelli, MA. Darlene Antonelli is a Technology Writer and Editor for wikiHow. Darlene has experience teaching college courses, writing technology-related articles, and working hands-on in the technology field. She earned an MA in Writing from Rowan University in 2012 and wrote her thesis on online communities and the personalities curated in such communities. This article has been viewed 4,140 times.
How helpful is this?
Co-authors: 3
Updated: December 19, 2022
Views: 4,140
Categories: Google Applications
Advertisement