I'm confused as to when I can actually use this option as it's always greyed out, whether the lines are highlighted or not.
Asked
Active
Viewed 906 times
1 Answers
14
You need to right-click the very narrow area between the line numbers and the +/- symbol for the 'Discard modified lines' option to be available when you want to discard a contiguous block containing both added and removed lines.
When you have a block containing only one of added or removed lines, you can right-click on any individual line to discard it -- or use the same approach as above, using the left mouse button to first select multiple lines, then right-clicking in the very narrow area to bring up the menu.
There is an open issue about this non-obvious UX here.

Hugh W
- 716
- 2
- 10
- 33
-
2Similarly, left-clicking that non-obvious area will allow you to de-select the entire modified block for the commit. – Omar Shishani Jun 21 '23 at 16:03