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?

vanta mula
  • 131
  • 1
  • 2
  • 8

1 Answers1

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

eftshift0
  • 26,375
  • 3
  • 36
  • 60