OK, so I added and committed an entire subdirectory to git (no push yet, still local, to .git).
I then deleted the entire subdirectory. (.git is still there.)
I now want it back, from git. How do I do that?
I tried git checkout but it only lists the delete files in that subdirectory.
What am I missing?
You have to do
git checkout subdirnameYou can also do
git checkout -- subdirnameThe
--is used to avoid ambiguity ( like say if you had a branch that was namedsubdirnameand other corner cases.) Below is a snippet from man forgit checkout:If you have an unfortunate branch that is named hello.c, this step would be confused as an instruction to switch to that branch. You should instead write:
http://git-scm.com/docs/git-checkout