I'm trying to restore a folder I deleted in a local branch but I am having trouble doing it. I have created a new branch from main and deleted one of the folders, while I worked on the branch and did 10 commits later.
Now, I want to have the deleted folder in the working directory along with the git indexing.
I have tried -
git checkout HEAD~10 -- ./gt/foo/
referring to this question but I keep getting -
error: pathspec './gt/foo/' did not match any file(s) known to git
I have also tried -
git restore -s main -SW -- gt/foo
to pull the folder from main working branch but got the same error.
What can I do to restore this folder?