How can i copy a file from local commit on a different branch?
问题 I committed a file on master branch but not pushed remote . Now i am working on feature branch and i want that file to be copied to feature branch from master branch. How can i do this? 回答1: You can checkout a specific file from another branch: git checkout master -- path/to/file The file will be copied from the branch as is into the working tree, and automatically staged. Note that the relative path from the working tree root is important. For example if you are in the root of the working