Reputation: 4652
I committed my code and when I do a git pull
I found some conflicts. How do I solve the conflicts and only get the file version from pulling without my committed changes?
Upvotes: 2
Views: 14002
Reputation: 26958
you can do
git reset --hard HEAD^
git pull
Unstage all of your changes and do a fast-forward merge. There is no need to solve the conflict anymore.
Upvotes: 8
Reputation: 2554
You can hard reset your branch to the commit before your changes, and then cherry pick each of the subsequent commits. This will bring your branch to a state that includes everything except for your changes.
Upvotes: 2