skip to Main Content

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+Zs I did in explorer?

PS: The reason I did those Ctrl+Zs 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!!

2

Answers


  1. 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.

    Login or Signup to reply.
  2. Unsaved files can be stored temporarily.
    Have you tried checking the following directories?

    Windows User

     C:UsersUSERNAMEAppDataRoamingCodeUserHistory
     C:UsersUSERNAMEAppDataRoamingCode
    

    For Linux users they are found at

     ~/.config/Code/Backups
    

    Insiders on macOS:

    ~/Library/Application Support/Code - Insiders/Backups
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search