Skip to main content
2 of 13
fixed style
Mot
  • 29.2k
  • 24
  • 85
  • 122

Or for arbitrary refs, git update-ref -m "reset: Reset <branch> to <new commit>" <branch> <commit>. (You can pick nits about the reflog message if you like - I believe the branch -f one is different from the reset --hard one, and this isn't exactly either of them.)

Adam A
  • 14.6k
  • 6
  • 32
  • 41