Steps i performed:
I have two branches branch1 and branch2,
$git branch --Initial state
$branch1
$git checkout branch2
$git pull origin branch1 --Step1
Try using git reflog
to find out where your branch was before the merge and git reset --hard
to restore the old revision.
Reflog will show you older states of the branch, so you can return it to any change set you like.
Make sure you are in correct branch when you use git reset
To change remote repository history, you can do git push -f
, however this is not recommended because someone can alredy have downloaded changes, pushed by you.