git checkout master
git reset –hard tag_ABC
git push –force
Git: reset hard Master to tag
Leave a reply
git checkout master
git reset –hard tag_ABC
git push –force
When you push a branch to a remote branch that has been updated by someone else in the meantime, without doing a pull before to update your local working directory, you will get the follow error:
$ git push
To ...
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '...'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
Continue reading