How can I undo discard changes in GitHub Desktop?
Solution 1
Emailed the Github support team and was told that after this option disappears, there is no other way to Undo the change. They may implement this feature at a future time.
Solution 2
As of 5/8/18, and if you're using the latest version of github desktop or github desktop beta, uncommitted discarded changes are now copied over as new files and put into your trash/recycling bin.
This is what the current prompt looks like:
Solution 3
First of all, Don't Close the VS Code.
Then open all the Files Where you have done Discard Changes.
Press Ctrl+z for Undo & CTRL+S for saving the changes.
It's worked for me.
Solution 4
You can find those discarded files in the recycle-bin.
Solution 5
GitHub Desktop Menus -> Repository / Restore Discarded changes
Related videos on Youtube
Comments
-
Franck Dernoncourt almost 2 years
Is there any way to undo discard changes in GitHub Desktop, after the Undo button has disappeared?
I am talking about GitHub Desktop's undo feature, not git in general.
-
Franck Dernoncourt about 8 years@TheGeorgeous Thanks, if I use Git Shell, which command should I run?
-
Vartika Gupta about 6 yearsYou can check recycle-bin once.Sometimes discard file are there in recycle bin and you can restore the same but remember the version you have discarded will only appear. If you have done changes after discarding that will not merge into it.
-
-
Asking Questions about 7 yearsWhere is the GitHub desktop Menus?
-
chrismarx almost 6 yearsThis answer is for an outdated version
-
chrismarx almost 6 yearsThis menu item has been removed, see this answer: stackoverflow.com/a/50240230/228369
-
chrismarx almost 6 yearsThis only applies to files that actually were committed, in this case, we're looking for files that were never staged or commited
-
Ishani Gupta about 5 yearsSaved my day !!
-
unobatbayar over 2 yearsYou're a legend.
-
Diogo over 2 yearsSaved my day bro [2]
-
iamcastelli over 2 yearsThank you a thousand bunch. It's at times like this where a wish I could buy a coffee/beer for the devs/product team who thought of such a helpful feature. Saved me a to of sweat and tears.
-
b.stevens.photo over 2 yearsAs with everyone else here you saved my day and probably a weeks worth of work
-
underdark over 2 yearsThank you, this saved my work after accidentally deleting a repository.
-
S.Hasan about 2 yearsFour years and still this is saving lives! Thank you
-
Fred Johnson about 2 yearsyou saved weeks of work. ty!
-
Hitesh Kushwah almost 2 yearsThnx man you save my life my whole 1-month work saved