The problem is the following: how to fetch a few files from a previous commit in git?
I could get the files one by one and replace them by their old version:
git show <commit>:<path> >! path
However, I would like to know whether there is a different way of performing the same thing, possibly with git reset
.
In fact, I gather that
git reset <commit> <path>
puts the old file into the index. But how can the files in the index be moved back to the working tree? Or is this a bad approach?
PS: There is a wonderful graphical explanation that makes everything clear: http://marklodato.github.com/visual-git-guide/.