'If I deleted all my git meta files by accident how do I fix it

On a secondary git worktree I was trying to fix something and instead I deleted all the meta info in .git/worktrees/git-2/ e.g. index, head, orig-head, log/.

I still have my changes in the working directory but I have messed up and am very very concerned what do I do

git


Sources

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

Source: Stack Overflow

Solution Source