How can one discard individual changes in a file in Visual Studio Code?

Visual Studio-Code

Visual Studio-Code Problem Overview


In Visual Studio Code, you can rollback all the changes to a file:

enter image description here

But is it possible if you have multiple changes in a file on multiple line numbers, to rollback only one of them, as one can in PhpStorm?

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

Update: in the October 2017 release, "inline change review" was introduced, where you can easily discard a particular change in the same way as you would in IntelliJ-based IDEs:


Previously, this was only possible with the Open Changes UI (located in the upper right of editors ). Alternatively, you can run the Git: Open Changes command.

In that view, the More button () offers several options for operating on individual lines, among them Revert Selected Ranges.

Solution 2 - Visual Studio-Code

There is Revert Selected Changes. Either hit Ctrl+Shift+P on the diff viewer to revert selected or simply use Ctrl+K,R

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEdward TanguayView Question on Stackoverflow
Solution 1 - Visual Studio-CodeGama11View Answer on Stackoverflow
Solution 2 - Visual Studio-CodeAmitView Answer on Stackoverflow