Search code examples
github-desktop

Github Desktop - "Discard modified lines" option greyed out


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.

enter image description here


Solution

  • To discard a contiguous block containing both added and removed lines, you need to right-click the very narrow area between the line numbers and the +/- symbols. Otherwise the 'Discard modified lines' option is disabled.

    This is where to click

    When you have a block containing only one of added or removed lines, you can right-click on any individual line number and then discard that line from the menu. Alternatively you can use the same approach from above, first selecting multiple lines with the left mouse button, then right-clicking in the very narrow area to bring up the menu.

    There is an open issue about this non-obvious UX here.