I get asked a lot from the developers “how do I reset a branch in Git”, This is very easy to do if you did not pushed the branch to the origin yet. You can reset the branch to the upstream branch by using the following commands.

git checkout thebranch
git reset --hard origin/thebranch

If you have any questions or comments please email me at john@johnathanmarksmith.com



Published

15 December 2014

Tags