Reset local git branch

Sometimes it happens that you mess up your local git repository or just have to many changes you don't need any more. There is a simple way to reset your local git repository to the connected origin branch:

$ git reset --hard origin/master

In this case you would reset to the master branch of your remote origin.

Be careful with this command though, as it also deletes all your stashed data.

comments powered by Disqus