code: def fetch_and_reset_hard(self, commit="origin"):
      repo = Repo(self.path)
      # Fix: `error: Your local changes to the following files would be overwritten by merge`,
      # because WSL2 Docker set 755 file permissions instead of 644, this results to the error.
      repo.git.fetch(all=True)
      repo.git.reset(commit, hard=True)
      self.have_info_from_repo = False
  
imports: from __future__ import annotations
  import configparser
  import os
  import threading
  import re
  from modules import shared, errors, cache, scripts
  from modules.gitpython_hack import Repo
  from modules.paths_internal import extensions_dir, extensions_builtin_dir, script_path
label_desc: Use image node_id 8 for calling the Extension obj's underlying member method code with example usage: obj.fetch_and_reset_hard(commit) without return types