I'm just starting with Git and I've got something that I need to reverse to a previous commit. I can do this locally no problem.
git reset --hard hashcode (or using sourcetree)
However when I try to push to bitbucket, souretree is gives me an error until I pull the previous commits down and I'm back where I started unable to revert to hte previous commit.l
How do I revert to a previous commit locally and then push to bitbucket overriding and removing all the commits that came after the one I'm reverting to?
The error message is:
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin Development:Development
Pushing to git@bitbucket.org:Username/project.git
To git@bitbucket.org:Username/project.git
! [rejected] Development -> Development (non-fast-forward)
error: failed to push some refs to 'git@bitbucket.org:Username/project.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.