Git: First rewinding head to replay

Rollerball picture Rollerball · Mar 11, 2014 · Viewed 84.1k times · Source

I am getting this message:

 First, rewinding head to replay your work on top of it...

each time I do a git pull --rebase origin <branch>, however I would like to discard all my work that may be replayed on top of it.. Basically I would like to rebase only the origin branch without my work on top of it. How can I clean those commits that comes up wrongly all times I try to pull rebase? Again, my goal is just pull rebase the exact snapshot of the origin branch without my work on top of it. Thanks in advance.

Answer

aragaer picture aragaer · Mar 11, 2014

git fetch origin; git reset --hard origin/<branch>