Pregunta

My folder structure looked like this:

root -> Model -> Simulation -> (many sub directories and files in it)
  1. I committed it and the sha is 022f5fb.

  2. Later I deleted the Simulation folder. And it was committed.

  3. And then many commits were committed all which involved addition of new files and removal of certain other etc etc.

Now I need to get the Simulation folder and all the files in it recursively (at the time of commit 022f5fb) to the current working directory.

I know I have to do something with git checkout 022f5fb or something but that will checkout the whole working directory. I only need Simulation folder and its contents.

Is it possible?

¿Fue útil?

Solución

git checkout 022f5fb -- path/to/Simulation

should do it. Also see the git checkout main page.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top