Skip to content

How do I revert / discard specific lines of a file when staging prior to a commit? #3460

Answered by stefanhaller
Moult asked this question in Q&A
Discussion options

You must be logged in to vote

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 hit d for "discard". d is a very general keybinding in lazygit for discarding, deleting, or dropping all sorts of things.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@stefanhaller
Comment options

Answer selected by Moult
@Moult
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants