Commands
but discard
Discard uncommitted changes from the worktree.
Discard uncommitted changes from the worktree.
Discard uncommitted changes from the worktree.
This command permanently discards changes to files, restoring them to their state in the HEAD commit. Use this to undo unwanted modifications.
The ID parameter should be a file ID as shown in but status. You can discard a whole file or specific hunks within a file.
Examples
Discard all changes to a file:
but discard a1
Usage: but discard <ID>
Arguments
<ID>— The ID of the file or hunk to discard (as shown in but status) (required)
Last updated on