1. Home
  2. Helpful Tips
  3. How to reset git repository to master

How to reset git repository to master

I’ve found sometimes after I’ve reverted commits, my remote repository will ask for change comments when I’m updating it.

To reset my remote repository to the master branch and remove any and all local changes, just do this:
$ git reset --hard origin/master

It will say something like this:
HEAD is now at 6934401 Fix sentry #412750341

Updated on April 12, 2018

Was this article helpful?

Related Articles

Leave a Comment