Sublime Forum

Undo all changes on all open files Sublime 3

#1

Anyone knows how to undo all changes done on all open files in Sublime 3? I changed all</li> tags on my xml to <br /> and <li> to • - bullets and clicked save all on file menu… when undoing I need to see each file and click ctrl +z… it will take too long coz i have too many files opened… i want to back up first the unedited version. Thanks in Advance :slightly_smiling:

0 Likes

Undo after find and replace in multiple files
#2

You could probably write a plugin to do that (go through open tabs and undoing), although it would mean maybe investing more time than doing it manually :slightly_smiling:

Are you using git or anything similar? Else I suggest doing it in the future so you can easily revert.

0 Likes

#3

Execute this in the console: [(v.run_command("undo"), v.run_command("save")) for v in window.views()]

You should perform your backup manually (copy the entire folder somewhere else).

4 Likes

Undo after find and replace in multiple files
#4

This might be stupid but i don’t know where that console is… is it within the sublime app?

0 Likes

#5

Nope i’m not using git … For now i did it manually and I might not be able to write a plugin for this coz i don’t know how yet

0 Likes

#6

Yes, it is in ST. Type Ctrl + ` (back tick). Or click the little rectangle on the extreme left of the status bar and choose Console. When you type commands in the console, remember to press Enter when finished typing.

1 Like

#7

Wow great help. thanks this is working… this will be helpful in the future :slightly_smiling:

0 Likes

#8

Thanks @Jackeroo tried @FichteFoll code on console and it worked :slight_smile:

0 Likes