Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
"apply Changes" has discarded all my changes. #451
Issue Type: Bug
VS Code version: Code 1.24.1 (24f62626b222e9a8313213fb64b10d741a326288, 2018-06-13T17:41:50.128Z)
referenced this issue
Jul 20, 2018
First, I'm really very sorry that you lost your work.
Apply Changes is to be used to take the changes from a file revision and apply those changes to your working copy. It is not for saving (or staging) your working changes. So given that, Apply Changes should have taken your working changes and applied them to your working copy (basically a no-op), but unfortunately there was a bug in the code that caused it to use the changes from HEAD rather than the working copy.
I will fix that ASAP and it will be in the next GitLens release. I am also changing the order of operations for how Apply Changes works. Before I would tell git to apply the requested changes to the working copy (git checkout) and then I would have vscode open the file. Instead, I will first have vscode open the file, and then have git update it. That way vscode will add the changes to the undo buffer, so that the changes could also be easily undone if needed.
Again I'm really sorry for the time and work lost.