Git: Discard Changes Back to Last Commit May 3rd, 2013 git reset --hard HEAD~ Fixes the annoying “Your branch is ahead by blahblahblah commits.”