I accidentally ran this command and lost my code. Is it revertable?
git checkout -- folder/*
I accidentally ran this command and lost my code. Is it revertable?
git checkout -- folder/*
Since it is not revertible, check your IDE in which you developed that code.
If you have a recent enough VSCode, you should be able to:
That supposes however that you remember how those files were named.
The other option is to check if you had activated Time Machine on your Mac.
In the future, use git switch
instead of git checkout
: it deals only with branches, and will not override files.