'How do I get back all the changes in VSCode?

I am learning Git and ran some commands to push code on GitHub.

I then made some changes and added new code ran some commands like pull and now my code is gone from VSCode?

How do i get back all the code in VSCode?

git


Solution 1:[1]

Check in command line a git status, git diff, and git stash list, just to check if your work in progress was already added, but removed or stashed.

And check if, in VSCode, a simple CTRL-Z (undo) on a specific file would be enough to restore it to its state before the latest pull.

In general, make sure to commit before pulling. That way, even if something disappear, you can always get back to that commit

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC