How do I revert / discard specific lines of a file when staging prior to a commit? #3460
-
If I select a file and press In git gui, I can select line(s) then right click and press revert lines/hunk. I saw this discussion #3157 but that seems to be after you commit, whereas I'm talking about prior to committing, when I'm busy staging. Awesome tool by the way I love it! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Try pressing |
Beta Was this translation helpful? Give feedback.
I don't think that was the question.
What git gui calls "revert" is called "discard" in lazygit. (That's a better name because "revert" has a different meaning in git.)
To do that, select the lines that you want to discard (either using
v
, or just by pressing shift-down-arrow), and hitd
for "discard".d
is a very general keybinding in lazygit for discarding, deleting, or dropping all sorts of things.