Mot
Mot

Reputation: 29590

Reset remote tracked branch

How can I reset the branch pointer of a remote tracked branch to one of its previous commits, so it looks like I didn't pulled (something similar like reset hard for local branches)?

Upvotes: 11

Views: 1350

Answers (1)

CharlesB
CharlesB

Reputation: 90406

You can set the reference to any other commit with:

git update-ref refs/remotes/origin/master <commit-sha1 or tag>

This will make remote branch origin/master point to the commit you specified.

Upvotes: 11

Related Questions