# fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.

- **ID:** `git/ambiguous-argument-revision`
- **Domain:** git
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The repository is empty (no commits) or HEAD is invalid, causing Git to fail to resolve 'HEAD' as a revision.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| git 2.20 | active | — | — |
| git 2.30 | active | — | — |
| git 2.45 | active | — | — |

## Workarounds

1. **If the repository is empty, make an initial commit: git add . && git commit -m 'Initial commit'. This creates a valid HEAD.** (95% success)
   ```
   If the repository is empty, make an initial commit: git add . && git commit -m 'Initial commit'. This creates a valid HEAD.
   ```
2. **If HEAD is corrupted, reset it to a known state: git symbolic-ref HEAD refs/heads/main (if main branch exists) or reinitialize the repository: git init (backup data first).** (75% success)
   ```
   If HEAD is corrupted, reset it to a known state: git symbolic-ref HEAD refs/heads/main (if main branch exists) or reinitialize the repository: git init (backup data first).
   ```

## Dead Ends

- **** — The error is about HEAD not being resolvable, not about a missing branch; checkout will fail with a different error. (80% fail)
- **** — These commands may also fail with the same error if HEAD is invalid; they don't fix the underlying issue. (70% fail)
