Assuming there were one or more bad merges to the current branch and we want to go back to a cetain (merge, or otherwise) commit before them:
git checkout <good-commit-hash> -- .
This will stage all file changes without checking out any branch or putting it into a weird state.
Not that any files added since said commit will not be removed automatically, so they may need to be deleted manually.