I have a git repo on my local and I push it to BitBucket.
I have a deleted folder in my previous commit, which I now want to bring it back.
On my local machine, I do
git checkout COMMIT_ID path/to/deleted/folder
and I got
error: pathspec path/to/deleted/folder did not match any file(s) known to git.
Any advice?
A cause of the error is likely to be that you're trying to checkout the directory from a revision it didn't exist in. Are you absolutely positive that in COMMIT_ID
the directory existed?
By the way, the command should be
git checkout COMMIT_ID -- path/to/deleted/folder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With