Casey West
Casey West

Reputation: 576

How to reset remote branch to certain commit?

Okay so here it is, a mess was made and we need to reset a branch to a specific point in history. At this point I have gone into SourceTree and locally reset the branch to the appropriate commit.

How do I get the pushed branch to match? Currently it says I'm multiple commits behind and I'm not sure how to get rid of those changes.

If you need any other information please let me know. Thanks.

Upvotes: 1

Views: 912

Answers (1)

larsgrefer
larsgrefer

Reputation: 2853

git push origin local_branch:remote_branch -f

Be aware that this might be confusing for other people working which might have based their work on the old state.

EDIT: Adjusted to the names from your comment:

git push origin 0001:iSo546 -f

Upvotes: 3

Related Questions