Is it possible to run
git fsck
For a specific folder when I am sure that the files I have deleted were located under a specific folder in my Mac?
Is it possible to run
git fsck
For a specific folder when I am sure that the files I have deleted were located under a specific folder in my Mac?
Copyright © 2021 Jogjafile Inc.
Git doesn't delete the objects, it just removed the reference to it.
The
git-fsck
command verifies the connectivity and validity of the objects in the database.You can execute the
git-fsck
command on the repository. With the--unreachable
argument, it will show you the objects that are unreachable i.e unreachable commit , unreachable blob, etc.. After that, you can also use thegit-show
command to see each object. Once you have found which one corresponds to the files you have deleted, you can rungit-stash apply *commit ID*
to apply the commit to your master branch again.