You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Discard all changes is very slow, far slower than git checkout -- . #2629
You're right in pointing out that discard changes in GitHub Desktop is far slower than performing a checkout. We have made strides to improve this but the core difference is that git checkout -- . deletes any local working directory changes with no chance of retrieval again whereas GitHub Desktop moves discarded files to trash (Recycle bin) on Windows. We're simply limited by the APIs available to us here (electron only exposes methods for moving one file to trash at a time and that method is synchronous).
Hopefully this is something we'll be able to improve upon going forward, either through better consumption of the underlying Windows APIs or possibly by providing a way to opt out of being able to restore discarded changes but it's not part of our immediate focus.
I'm marking this as future-proposal and closing this issue out in order to keep our issue list manageable.
Hi @abenhamdine, thanks for this report. Given the relative infrequency of discarding a huge amount of changes and the limitations @niik described above, I'm going to remove the future-proposal label here. If we continue to hear reports from folks experiencing delays in their normal workflow as a result of something like this, we'll definitely revisit. Thanks again for letting us know!
Discarding all changes (even for relatively few changes files) is very slow for me — on the order of several seconds to over ten seconds for many changes. It's quite frustrating, as this is not an uncommon action for me. A way to clear changes (even if it means discarding permanently, without sending to Trash) would be a huge improvement for me.
@varkor Is discarding more than, say, 10, files a frequent occurrence for you? Just trying to understand how it's causing frustration. Also, how long does it take to discard a few files? Would you be willing to share a screen capture?
@varkor Is discarding more than, say, 10, files a frequent occurrence for you?
Yes.
Also, how long does it take to discard a few files?
A surprisingly long time. I've just tried discarding 20 files and it took over 10 seconds. (I would expect discarding this few files to be essentially instantaneous.)
Would you be willing to share a screen capture?
(The type of changes here are not necessarily representative, but the time it takes is.)
As an aside, while this problem persists, it would be nice if the modal dialogue could display some feedback — at the moment you click "Discard", and nothing appears to happen until discarding completes.
I'm encountering this when switching from a branch that ignores node_modules to one that does not. I might have 10,000 files to discard. I've learnt it's best to just go and shift+delete the folder rather than attack it through github desktop.
yep, some big projects that are made using game engines, generate a large amount of files during editing(5k, sometimes even more). And i dont really care about those files being saved to the bin, i would like to just discard changes without recovery.
Same here, unity (game engine) uses .meta files for everything, effectively doubling the amount of tracked files, and this makes it take a surprisingly long time to discard all changes (>2 minutes for ~1200 files). And cancelling doesn't even work while it's doing this.
Edit: a workaround is to stash the changes and discard the stash, interestingly this happens instantly.
Bruh six years still so bloated. ☠ How can you do nothing and mark it as closed. 🤦♂️ At least add an option to delete perma
idk why the GD team disregards things like this that are simply just common sense and have been asked to be looked into for anywhere from 5-10 years ago in some cases.
Bruh six years still so bloated. ☠ How can you do nothing and mark it as closed. 🤦♂️ At least add an option to delete perma
idk why the GD team disregards things like this that are simply just common sense and have been asked to be looked into for anywhere from 5-10 years ago in some cases.
A bit maddening.
Yeah, clearly.
I also have this problem, and it'd be great to have a solution, instead of wasting ages for nothing.
Activity
niik commentedon Sep 7, 2017
Hi @abenhamdine, thanks for opening this.
You're right in pointing out that discard changes in GitHub Desktop is far slower than performing a checkout. We have made strides to improve this but the core difference is that
git checkout -- .deletes any local working directory changes with no chance of retrieval again whereas GitHub Desktop moves discarded files to trash (Recycle bin) on Windows. We're simply limited by the APIs available to us here (electron only exposes methods for moving one file to trash at a time and that method is synchronous).Hopefully this is something we'll be able to improve upon going forward, either through better consumption of the underlying Windows APIs or possibly by providing a way to opt out of being able to restore discarded changes but it's not part of our immediate focus.
I'm marking this as
future-proposaland closing this issue out in order to keep our issue list manageable.billygriffin commentedon Nov 14, 2018
Hi @abenhamdine, thanks for this report. Given the relative infrequency of discarding a huge amount of changes and the limitations @niik described above, I'm going to remove the
future-proposallabel here. If we continue to hear reports from folks experiencing delays in their normal workflow as a result of something like this, we'll definitely revisit. Thanks again for letting us know!varkor commentedon Feb 27, 2019
Discarding all changes (even for relatively few changes files) is very slow for me — on the order of several seconds to over ten seconds for many changes. It's quite frustrating, as this is not an uncommon action for me. A way to clear changes (even if it means discarding permanently, without sending to Trash) would be a huge improvement for me.
billygriffin commentedon Feb 27, 2019
@varkor Is discarding more than, say, 10, files a frequent occurrence for you? Just trying to understand how it's causing frustration. Also, how long does it take to discard a few files? Would you be willing to share a screen capture?
varkor commentedon Mar 4, 2019
Yes.
A surprisingly long time. I've just tried discarding 20 files and it took over 10 seconds. (I would expect discarding this few files to be essentially instantaneous.)
(The type of changes here are not necessarily representative, but the time it takes is.)
As an aside, while this problem persists, it would be nice if the modal dialogue could display some feedback — at the moment you click "Discard", and nothing appears to happen until discarding completes.
varkor commentedon Mar 5, 2019
Note that discarding even a couple of files can take ~5 seconds to complete. This problem does not just occur with many files.
Mark-Hetherington commentedon Nov 14, 2019
I'm encountering this when switching from a branch that ignores node_modules to one that does not. I might have 10,000 files to discard. I've learnt it's best to just go and shift+delete the folder rather than attack it through github desktop.
jswigart commentedon Nov 30, 2022
This needs an option to discard the files without recovery, and some text that warns of the cost. It's ludicrous how long this takes
Mixarar commentedon Feb 11, 2023
yep, some big projects that are made using game engines, generate a large amount of files during editing(5k, sometimes even more). And i dont really care about those files being saved to the bin, i would like to just discard changes without recovery.
Flavelius commentedon May 24, 2023
Same here, unity (game engine) uses .meta files for everything, effectively doubling the amount of tracked files, and this makes it take a surprisingly long time to discard all changes (>2 minutes for ~1200 files). And cancelling doesn't even work while it's doing this.
Edit: a workaround is to stash the changes and discard the stash, interestingly this happens instantly.
astyd256 commentedon Dec 11, 2023
Bruh six years still so bloated. ☠
How can you do nothing and mark it as closed. 🤦♂️
At least add an option to delete perma
Shreeniwas1 commentedon Aug 12, 2024
yeah at least
blackletum commentedon May 14, 2025
idk why the GD team disregards things like this that are simply just common sense and have been asked to be looked into for anywhere from 5-10 years ago in some cases.
A bit maddening.
Nexesenex commentedon Jun 14, 2025
Yeah, clearly.
I also have this problem, and it'd be great to have a solution, instead of wasting ages for nothing.
JohnJHargrove commentedon Nov 7, 2025
Having this issue today. Discarding changes feels like it's never going to end.
I can't tell if it's still actually working or if it's permanently hung.
I'm now trying to learn command prompt workarounds because I'm hard blocked by github desktop.