Hard-reset config to a commit
git_git_rollback_to_commitHard-reset the entire Home Assistant config directory to a known commit, discarding all later commits and uncommitted changes. Requires confirm=True to prevent accidental data loss.
Instructions
Hard-reset the entire HA config directory to a previous commit.
Without confirm=True returns a safety prompt naming the current head commit;
with confirm=True calls repo.git.reset('--hard', sha), which
discards every commit and uncommitted change made after sha.
Use when: reverting /config entirely after a bad batch of changes, and
the target commit is already known.
Not for: restoring a single file — use git_git_rollback_file.
Returns: dict {"status": "reset", "to": sha} on success.
Errors: returns {"error": "confirmation_required", "message": ..., "action": ...} when confirm is not True; raises RuntimeError (from
_repo()) when no git repo exists.
Limits: requires confirm=True. WARNING: every commit and uncommitted
change made after sha is permanently and irreversibly lost.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | Yes | Commit SHA or ref to hard-reset the entire config directory to. | |
| confirm | No | Must be True to actually perform the reset. False (default) returns a safety prompt naming the current HEAD instead of touching anything. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||