Pavindu
Pavindu

Reputation: 3112

Undo changes of a set of selected files in VS Code Git

I have accidentally run eslint fix in my React.js app and now have about 160 files been changed, but they are not relevant to the branch that I'm currently working on. Therefore I have to undo the file changes, but reverting files one by one takes a lot of precious time and there are some file changes that I need to keep.

How can I undo only a set of selected changed files at once in the VS Code?

Upvotes: 1

Views: 324

Answers (1)

VonC
VonC

Reputation: 1323483

I would recommend:

  • stashing files you want to keep (which you can do with GitLens)
  • hard restting to a previous commit
  • applying your stash

That way, you don't have to revert files one by one.

Upvotes: 1

Related Questions