{
  "id": "cmd.git-soft-reset-safe",
  "version": 1,
  "category": "command_snippet",
  "severity": "medium",
  "lifecycleStatus": "ACTIVE",
  "lifecycle": {
    "status": "ACTIVE",
    "appliesTo": "Evergreen / Git >= 2.30",
    "verifiedAt": 1795800000000,
    "reviewDueAt": 1858872000000,
    "replacedBy": "",
    "retireReason": ""
  },
  "contentOrigin": "HUMAN_ORIGINAL",
  "aiModel": "",
  "summaryEn": "Reversible Git command to undo the last unpushed local commit while preserving all file changes in the staging index.",
  "match": {
    "field": "command",
    "containsAny": [
      "git reset --hard head~1",
      "git reset --hard origin/"
    ]
  },
  "actions": [
    "ALERT_USER",
    "EXPLAIN_TO_USER"
  ],
  "indicators": [],
  "knowledge": {
    "environment": "Git >= 2.30 on Windows, macOS, and Linux",
    "symptom": "Uncommitted edits or newly created files are permanently wiped when rolling back a local commit carelessly.",
    "rootCause": "Hard resets discard tracked modifications immediately without placing them in the staging area for inspection.",
    "verifiedFix": "Prefer `git reset --soft HEAD~1` on unpushed local commits so every change remains staged and inspectable before recommitting.",
    "verificationCheck": "Run `git status --short` after reset to confirm all modified files remain intact in the index.",
    "commandPattern": "git reset --soft HEAD~1",
    "commandRisk": "REVERSIBLE",
    "license": "CC0-1.0",
    "sourceBasis": "OFFICIAL_DOCS_SUMMARY"
  },
  "playbookSha256": "c75363340f35b879a3de5837440638ea77fa2ab2330bfba67288687865a1217a",
  "snapshotSha256": "116114a19ef52fd932a20216d0c0a4136c3ef2489839d44e6e031683fb594cd2",
  "advisoryOnly": true
}
