Undo local changes in vscode at specific line with shortcut

Viewed 1822

I'm using vscode for programming and I have some local changes in my file. If a file has local changes, the changed lines will be marked on the left side of the line number gutter as seen on the picture. You can undo those changes by simply clicking on the marks of the respective line.

However, is there a specific shortcut to revert the local change of the line where my cursor is currently located? This is because clicking on the mark is annoying after a while.

example I would like to revert the change in line 55

1 Answers
  1. Choose your code changed
  2. Press Command + Shift + P
  3. Type revert, you will see Git: Revert Selected Ranges
  4. Enter
Related