Copying a file from a different git branch
Sometimes one has to copy a file from one branch to another. The
git checkout command comes in handy in this situation. Let's say we need to copy a file named
destination-branch. First make sure you're in the
destination-branch. Then apply git checkout to copy the target file.
> git checkout destination-branch > git checkout sourche-branch path/to/target/file