Reputation: 1721
My friend made a branch user
and while I was on my master
I did git pull origin user
and now that branch has been merged to my master.
I realised it only after many other changes and commits, but we decided not to implement that branch any more. How do I remove those files from my master
and make my local master the same as the Github one?
I tried git reflog
but I'm not sure what information I get there, many commits are being repeated. My git status
shows my branch is 6 commits ahead.
Upvotes: 0
Views: 71
Reputation: 1721
I did git reset --hard origin/master
and it resolved all of my problems.
Upvotes: 1
Reputation: 505
A) Your uncommitted changes are still there, like you said, you can stash them and add them later.
B) Verify you're on the right branch and do git reset --hard
, that will revert all changes back and you'll be on the HEAD of the branch
Upvotes: 0
Reputation: 1162
Reset the not commited changes with a git reset --hard HEAD
More infos are here
How do I use 'git reset --hard HEAD' to revert to a previous commit?
Upvotes: 0