I pushed a change to a remote test git repo, then reset my local git repo to HEAD^, and now am trying to push my local repo to origin, but I get a “non fast forward” merger warning. If I do a git pull, my local repo gets nuked by the origin.
How can I either merge in the origin repo and tell it to throw away the merges from the origin or tell origin to accept my push, even though it is not a fast forward?
Thanks
The GitHub help page does summarize it nicely:
(In your case, a
git reset --hard)The question “Git reset –hard and a remote repository” adds that you need to be aware of the potential remote config
receive.denyNonFastForwards, which can deny your “git push --force“.In which case, some kind of revert needs to take place: alternatives are discussed at “GIT revert to previous commit… how?“.