英文:
Is it possible to redo the files from explorer in VS Code?
问题
我在VS Code的资源管理器面板中不小心按了7-8次Ctrl+Z
,导致一些文件被更改了。而且在资源管理器中似乎无法使用Ctrl+Y
来恢复所有更改!
我想确认一下,是否有任何方法可以撤销我在资源管理器中进行的那些Ctrl+Z
操作的相反操作?
附注:我之所以进行那些Ctrl+Z
操作,是因为我使用Ctrl+Shift+H
更改了一个变量的名称,并以为在资源管理器中执行Ctrl+Z
可以撤消那些名称更改,但似乎我丢失了许多代码和文件!
英文:
I did 7-8 Ctrl+Z
mistaken in explorer panel in VS Code and some files have been changed now. And it seems Ctrl+Y
doesn't work in explorer to bring everything back again!
I wanted to make sure if there is anyway that I can do the opposite of those Ctrl+Z
s I did in explorer?
PS: The reason I did those Ctrl+Z
s was because I changed name a variable using Ctrl+Shift+H
and thought by doing Ctrl+Z
in explorer I can undo those name replacements but it seems I have lost a lot of codes and files!!
答案1
得分: 1
你可以使用重做命令:Ctrl+Shift+Z
(macOS上为command+Shift+Z
)。
键盘快捷键可以在VS Code中自定义。
-
转到
文件 > 首选项 > 键盘快捷键
(macOS上为代码 > 首选项 > 键盘快捷键
)。 -
在搜索栏中搜索
重做
。
你可以在那里找到快捷键。或者如果你愿意,可以更改它。
如果你已经使用了替换全部(Ctrl + Shift + H
),你可能需要打开单个文件。
P.S. 如果你已经关闭了VS Code,可能无法还原:
- 它只在你没有关闭VS Code的情况下有效。一旦关闭,你就无法还原。
- 如果你在撤销之后没有进行任何更改,任何在撤销之后进行的更改都将成为最新的,并覆盖之前的修改。
我建议你在一个新文件中尝试这些操作,然后应用你的发现。
英文:
You can use redo command: Ctrl+Shift+Z
. (command+Shift+Z on macOS)
Keyboards shortcuts is customisable in VS Code.
-
Go to
File > Preferences > Keyboard Shortcuts.
(Code > Preferences > Keyboard Shortcuts on macOS) -
Search for
Redo
in search bar.
You can find the shortcut there. Or change it if you want.
If you have used Replace all (Ctrl + Shift + H
), you may need to open individual files.
P.S. You may not be able to revert if:
- It only works if you have not closed your VS code. Once you close it, you cannot revert.
- If you have not made any changes after Undo. Any change you make after undo you will be the latest and override your previous modifications.
I would suggest to try testing these in a new file and then apply your findings.
答案2
得分: 1
未保存的文件可以被暂时存储。
您尝试过检查以下目录吗?
Windows 用户:
C:\Users\USERNAME\AppData\Roaming\Code\User\History
C:\Users\USERNAME\AppData\Roaming\Code\
对于 Linux 用户,它们可以在以下位置找到:
~/.config/Code/Backups
macOS 上的 Insiders 版本:
~/Library/Application Support/Code - Insiders/Backups
英文:
Unsaved files can be stored temporarily.
Have you tried checking the following directories?
Windows User
C:\Users\USERNAME\AppData\Roaming\Code\User\History
C:\Users\USERNAME\AppData\Roaming\Code\
For Linux users they are found at
~/.config/Code/Backups
Insiders on macOS:
~/Library/Application Support/Code - Insiders/Backups
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论