0

I've done following commands:

git reset --hard <hash-id>
git push -f origin

Everything is ok on my local machine and on bitbucket, pointer is moved and newer commints than that commit () are deleted and that is ok but there is one other problem.

Now when other users do git pull on their local machines pointer is moved to but newer commits are ready to push. To repeate, pointer is moved but newer commits are there on their machines (git is offering push of that commits and they see changes in files).

Every help is welcome.

P.S. they can't do manual changes because there is 100 commits :(

Thank you

iWizard
  • 6,816
  • 19
  • 67
  • 103
  • Did you try `git pull -f`? On the other machines? Before you try please read the [docu](https://www.kernel.org/pub/software/scm/git/docs/git-pull.html) you should be absolutely sure about what you're doing if you're using the `-f` option – Jan Mar 04 '15 at 16:58
  • git pull -f not helped – iWizard Mar 04 '15 at 17:02

1 Answers1

1

Like mentioned here in the second answer:

(you) git reset --hard <hash>
(you) git push -f

(them) git fetch
(them) git reset --hard origin/branch

But, like also mentioned, this could turn into a mess. Before you execute those command you may should backup your repo (one of the local once if you already pushed).

To don't get into this mess you should prefer git revert. For example like that:

git revert HEAD~2..HEAD

Further information is available here and there.

Hope that helps you.

Community
  • 1
  • 1
Jan
  • 1,004
  • 6
  • 23