Reputation: 101
I accidentally pulled in changes from branch 1 into branch 2. How do I set my local copy of the branch 2 back to the last commit on the origin?
The changes haven't been pushed to the remote repository.
Upvotes: 1
Views: 239
Reputation: 27295
You can reset to the last state. Use git log
search for the last commit id then reset to that commit id with git reset --hard <id>
.
Upvotes: 1
Reputation: 3549
In each branch you want to go back to the "upstream" version, git reset --hard @{u}
(@{u}
is short for @{upstream}
)
Upvotes: 2