Reputation: 14318
I made some changes to a file (uncommitted), and want to revert some changes, but not others. VSCode provides a very nice set of buttons for resolving merge conflicts, which would be much more efficient than pulling up the diff of the file and copying over the bits I want to keep. Is there a way to treat a diff file or an applied stash of a file as a set of merge conflicts with HEAD?
git stash -- path/to/my/file
git stash apply
git stash apply
This obviously won't work because the changes to my file are identical to the changes being applied, which presents no merge conflicts.
Upvotes: 1
Views: 231
Reputation: 1739
temp
branch from current
branch.origin
to temp
brach.VS code
now.temp
branch.original
branch again.squash merge
of temp
branch to original
branch (git merge --squash temp
)Finally, you will end up what you want.
Instead of going through all these steps, you can use VS Code
or built-in git gui
tool(gitk
) for comparison.
Upvotes: 2