Reputation: 19695
I'm trying to remove 5 published commit from my git doing a hard reset to my specific commit.
The thing is that Sourcetree warns me, but it just move the HEAD.
So, basically, if I pull changes again, I recover my changes.
Also, I can't make changes, because I would have to pull changes first.
This is agains what I believed about hard reset; I thought it was the only "destructive" operation in Git.
Is there an alternative to this?
Upvotes: 0
Views: 59
Reputation: 887215
If you want to destroy things about the upstream repository, you need to run git push -f
to make its branch point to a different commit.
Beware that that will break anyone else who pulls.
Upvotes: 2