0

I am using Visual Studio Code, and I used the source control and then I uploaded all of my files to the changes folder. I wanted to remove them from this tab so I clicked Discard all Changes button. and then it just removed all of my files without the directories.

what should I do to fix that ?

phd
  • 82,685
  • 13
  • 120
  • 165
  • 2
    It looks like VSCode doesn't have a local history functionality by default. I'm afraid you might not be able to recover your changes. Take a look at this post and see if any of the options apply to you: https://stackoverflow.com/questions/7147680/accidentally-reverted-to-master-lost-uncommitted-changes Also, consider installing a VSCode plugging that enables local history for files so you won't put yourself in this situation next time! :) https://stackoverflow.com/questions/46446901/how-to-see-local-history-changes-in-visual-studio-code – Lucas Saldanha Jul 21 '20 at 22:58
  • 2
    If the files were at some point in the index, you might recover them by checking loose objects (not the most entertaining thing to do.. but possible): https://stackoverflow.com/questions/1108853/recovering-added-file-after-doing-git-reset-hard-head – eftshift0 Jul 21 '20 at 23:03
  • @eftshift0, - I didn't commit anything yet, is it help at something ? – RandomAnimal Jul 21 '20 at 23:11
  • 1
    [Under what circumstances may I add "urgent" or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569). Urgency removed. – phd Jul 21 '20 at 23:28
  • 2
    Just adding into the index is enough for git to add files into its DB. – eftshift0 Jul 21 '20 at 23:42

0 Answers0