Well the title is self explanatory. What will be the python code equivalent to running git reset --hard (on terminal) using GitPython module?
git reset --hard
You can use:
repo = git.Repo('repo') # ... # Remove last commit repo.head.reset('HEAD~1', index=True, working_tree=True)