Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reset remote tracked branch

Tags:

git

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)?

like image 392
Mot Avatar asked Dec 19 '12 14:12

Mot


1 Answers

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.

like image 112
CharlesB Avatar answered Sep 25 '22 10:09

CharlesB