0

I have a branch. My local branch has 5 (m) commits which I have not pushed to remote. The same branch is 7 (n) commit ahead of me. Now what I want to do is remove my 5 (m) unnecessary commits and become same as what remote branch is.

What I tried so far : 1) I went to specific commit where I and remote were same. 2) then I pulled from remote branch. 3) Now I and remote branch are same. 4) Now branch is called (HEAD detached from xxxxf)

How can I make (HEAD detached from xxxxf) branch the same as remote branch?

1
  • Have you tried to rebase on master?
    – SyncroIT
    Commented Apr 24, 2017 at 16:15

1 Answer 1

0

If you want to forget about your changes and just set your local branch where the remote branch is:

git checkout local-branch git reset --hard the-remote/remote-branch

Not the answer you're looking for? Browse other questions tagged or ask your own question.