The thing is, in a recent study vite + vue3 building project, the basic structure is good, are going to upload the git repository, then hand owing to perform the git reset – hard because no commit before, there would be no last version, so I write all the code were gone, my darling, 😨😨😨
The project looks like this:
Git FSCK –lost-found git FSCK –lost-found
Git FSCK –lost-found: git FSCK –lost-found: git FSCK –lost-found: git FSCK –lost-found: git FSCK –lost-found It should refer to the type of file, and then I found this picture below
This is how Git is stored, and there are three types of commit tree blob
commit
The data structure is generated after each commit as we proceedcommit
After that, one is created firstcommit
Component and then create onetree
Component, where all file information is stored, eachblob
Represents a file that can all be intree
Found inblob
The component does not store file information, but only the contents of the file. The file information is stored in the tree
Use git show to view the content
Good guy this is the file I want to find it, but how to restore it 😶🌫️
Git ls-tree provides a more intuitive view of the tree
Then in git show blob file, you can see the missing code
😮💨 won’t get back into the project, but also successfully retrieved code