Git revert local commit

Will picture Will · Jun 16, 2011 · Viewed 78k times · Source

I have a git repo hooked up in phpstorm on windows. I committed a few change sets then pushed them to our "central repo". After this I have then made a few more commits. I no longer want these commits that have not been pushed to the central repo. How do I clean my working copy to be the same as the central repo (origin)?

Answer

Steve Prentice picture Steve Prentice · Jun 16, 2011
git reset --hard remotes/origin/HEAD