I have a problem which is the reverse case of the problem here and here. My situation looks like this:
So, remotes/origin/master
is ahead of master
. When I issue git status
I obtain:
On branch master
Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
(use "git pull" to update your local branch)
However, I do not want to move or fast-forward master
to remote/origin/master
. Rather, I want remotes/origin/master
to move back or rewind to where master
currently is. All of the Local uncommitted changes, not checked in to index
has been backed up elsewhere so that after moving remotes/origin/master
back to master
, I can recreate the changes if needed. All of the changes currently in remotes/origin/master
are not useful and can be discarded.
I tried the following:
git branch -d babe82a3bb3efb71e6fdff38e40ec08fe691e5d6
in an attempt to achieve this rewind of remotes/origin/master
. This gives error:
error: branch 'babe82a3bb3efb71e6fdff38e40ec08fe691e5d6' not found.
I then tried:
git branch -d remotes/origin/master
, and this gives error:
error: branch 'remotes/origin/master' not found.
Is there a way to achieve this?