# CONFLICT (modify/delete): file.txt deleted in HEAD and modified in branch. Version branch of file.txt left in tree.

- **ID:** `git/conflict-modify-delete`
- **Domain:** git
- **Category:** conflict_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

One side of a merge deleted a file while the other side modified it, causing a modify/delete conflict.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| git 2.30.0 | active | — | — |
| git 2.39.0 | active | — | — |
| git 2.45.0 | active | — | — |

## Workarounds

1. **git checkout --ours file.txt && git add file.txt  # Keep the deleted side (HEAD), effectively deleting the file** (80% success)
   ```
   git checkout --ours file.txt && git add file.txt  # Keep the deleted side (HEAD), effectively deleting the file
   ```
2. **git checkout --theirs file.txt && git add file.txt  # Keep the modified side (branch), restoring the file with modifications** (85% success)
   ```
   git checkout --theirs file.txt && git add file.txt  # Keep the modified side (branch), restoring the file with modifications
   ```

## Dead Ends

- **** — Running git add on the conflicted file without resolving the conflict will keep the conflict marker in the staged file, leading to build errors or incorrect content. (65% fail)
- **** — Using git merge --abort when you actually want to keep changes discards all merge progress and requires starting over. (30% fail)
