Given a project with 2 files: fileA and fileB. Both were once added to a git-repository. Then I added fileA to .gitignore (and flushed the git-cache), so that in the current master only fileB is present. I would like to clone this repository to another machine now, but fileA is missing.
The next thing I did was to create a branch from the commit where both files were present. The big question now is: how do I get back to the master commit without losing that file again?
Sorry for the title. I was trying to be descriptive, but ..
If all you need to do is restore one file, you can do that with
git checkout:You will also have to edit your
.gitignoreso that it isn’t ignoringfileAanymore.