GIT-STAGE-BATCH-DISCARD(1)

NAME
git-stage-batch-discard - remove live changes or reverse batch changes

SYNOPSIS
git-stage-batch discard [--line IDS] [--file [PATH] | --files PATTERN...] [--from BATCH | --to BATCH] [--auto-advance|--no-auto-advance]

git-stage-batch discard [--file PATH | --to BATCH --line IDS] [--as TEXT | --as-stdin] [--no-edge-overlap]

DESCRIPTION
discard removes selected live changes from the working tree. With --to it first saves the selected live changes to a batch. With --from it reverses changes from a batch without deleting that batch.

WARNING: discarding live changes permanently removes them from the working tree unless they are saved with --to.

OPTIONS

--line, --lines IDS
    Discard or save only specific displayed line IDs.

--file
    [PATH] Operate on one complete file. If PATH is omitted, use the selected hunk's file. For a live discard, restore the path from the index and preserve staged content. New untracked files are removed because they have no indexed version. Use git rm -- PATH to intentionally remove a tracked file.

--files PATTERN...
    Operate on all changed files matched by gitignore-style patterns.

--from BATCH
    Reverse changes from BATCH.

--to BATCH
    Save selected live changes to BATCH before removing them from the working tree.

--as TEXT
    Replace selected live content with TEXT. For --file the text becomes the full working-tree file content. For --to --line, the replacement is saved in the batch before the selected original lines are removed.

--as-stdin
    Read replacement text from standard input exactly.

--no-edge-overlap
    Do not strip unchanged edge-overlap lines from replacement text used with --to --line --as.

--auto-advance
    Select the next hunk after the command completes.

--no-auto-advance
    Leave no hunk selected after the command completes.

EXAMPLES
    git-stage-batch discard --line 4-6
    git-stage-batch discard --to cleanup --file src/app.py
    git-stage-batch discard --from cleanup --files 'src/**'

SEE ALSO
git-stage-batch(1), git-stage-batch-include(1), git-stage-batch-apply(1)