Bug: Discard Unstaged Changes Corrupts File on Windows


When I discard changes in Atom for a file


The file contents are still in the editor, but when I try to close the file, it gives this warning, even though it was already saved previously and the editor buffer is not marked as dirty.


The file is no longer in the folder/project/directory tree.

I can select Show in Explorer and see the file in Explorer, but I cannot access it.

>cat app\controllers\users_controller.rb
cat: app\controllers\users_controller.rb: Permission denied
>icacls app\controllers\users_controller.rb /c
app\controllers\users_controller.rb: Access is denied.
Successfully processed 0 files; Failed processing 1 files
>handle app\controllers\users_controller.rb

Handle v4.0
Copyright (C) 1997-2014 Mark Russinovich
Sysinternals - www.sysinternals.com

atom.exe           pid: 66424  type: File           D10: C:\Users\Chloe\workspace\project\src\app\controllers\users_controller.rb

Even in an Administrator command prompt I cannot access it. I must delete the file, close Atom, then use git checkout file to restore it.

This is very bad.

Windows 8.1

>cmd /v
Microsoft Windows [Version 6.3.9600]


It seems like this issue is already being tracked on GitHub. Follow along and share your experience here: