My project failed to compile, so I unsuccessfully tried a variety of solutions over another 8 commits - including some changes I want to preserve.
So my master has some files from a variety of commits that I want to pull over to my "Last Known Good" branch. (Maybe I'll have to do a line diff tool to merge changes within a few files too.)
Best answers I've found on how to 'merge' selected files to another branch are at:
- How do I merge changes to a single file, rather than merging commits?
- https://jasonrudolph.com/blog/2009/02/25/git-tip-how-to-merge-specific-files-from-another-branch
- How to git-cherry-pick only changes to certain files?
I'm thinking that GitLens must have a way to right click on a file from a (otherwise evil) commit and perform a 'git checkout --patch CommitName FilePath' to add that commit's version of the file to the current checked out branch where I can test & likely commit it in the future.
I want to semi-automate this in VS Code as I have a lot of files to review/pull over.
I'm fairly new to git and GitLens and uncertain about all the options/terminology. Is this possible?!