Log into and head to Settings, then scroll down to Advanced to find Restore Files.įind the file you want to bring back from the list that appears, and check the box beside it. If you save files to iCloud, you can recover deleted files from there too. You can go through these snapshots and hit the Restore button there to save files as well.
#What is the redo command on a mac mac#
If you already back up your Mac with Time Machine, you can go into your Time Machine backup disk to find previous versions of the document you deleted and click the Restore button to put the document back on your Mac.Įven if you haven’t plugged in your backup disk for a while, your Mac saves local snapshots every hour once you start using Time Machine. There is a sort of undo you can perform if you’ve deleted a file you didn’t mean to delete. This can include emptying your trash, which permanently deletes files. Some apps have multiple levels of Undo, where you can go back dozens of steps, while others only have one. This is equivalent to selecting Edit > Redo in the menu bar. Text.Sometimes something happens that hitting the undo button or keystroke can’t fix. After performing an Undo, you can usually also Redo the last action by pressing Shift+Command+Z on your keyboard. Redo_button = tk.Button(root, text="Redo", command=text.redo) Undo_button = tk.Button(root, text="Undo", command=text.undo) Text = MyText(root, width=65, height=20, font="consolas 14") Self._undo_stack.append((undo_args, redo_args)) Tip: The shortcut key for Excel or the shortcut key in Word to redo an undo is Ctrl+Y most of the time (and +Y on Mac). Press +Z for multiple undo command for Mac. Press Ctrl+Z for undo command for Windows. Undo_args, redo_args = self._redo_stack.pop() This undo & redo can also be used in Microsoft Word. Self._redo_stack.append((undo_args, redo_args)) Undo_args, redo_args = self._undo_stack.pop() MS Word, Sublime text, and others all support command-Y as the 'redo' command on the Mac. Result = self.tk.call((self._orig,) + args) Undo_args = ("tag", "remove" if args = "add" else "add", args) + indexes Indexes = tuple(self.index(ind) for ind in args)
Self._undo_stack.append((undo_args, args)) Undo_args = ("insert", index, self.get(*args)) Undo_args = ("delete", index, "c".format(index, len(args)))
Self.tk.createcommand(self._w, self._proxy) Self.tk.call("rename", self._w, self._orig) Tk.Text._init_(self, master, undo=False, **kw) So it is possible to undo the modification by calling self.tk.call((self._orig,) + undo_args) and redo it with self.tk.call((self._orig,) + redo_args). If this modification is a text insertion, text deletion, tag addition or tag removal, the (undo_args, redo_args) tuple is appended to the undo stack. However, you need to append the needed (undo_args, redo_args) to the undo stack each time a modification occur and also clear the redo stack.įor that, I have adapted the proxy mechanism from Brayn Oakley's answer (about automatically updating line numbers).Įach time a modification of the Text widget occurs, the _proxy method is called. Then for the redo function, you do the same thing but taking the item from the redo stack and appending it to the undo stack. It will be typically an (undo_args, redo_args) tuple. You can undo no problem (Control/Command-Shift-Z) but whats the shortcut for redo The redo shortcut is normally either Control/Command-Shift-Z or. When you call the undo function, you take the last item in the undo stack, append it to the redo stack and use the information in the item to undo the modification. The idea is to have an undo stack and a redo stack. However, you can implement your own undo/redo mechanism that works with formatting. Like TheLizzard said, this is not possible with the builtin undo/redo mechanism of the Text widget.