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.
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.
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.
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:
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.
when you're using VS Code, don't close it, go to the file you discared the changes, right click on it, and go to "Open Timeline" and there you'll find all the changes you made on that file, then you can easily get back your last changes :)
You can find those discarded files in the recycle-bin.
GitHub Desktop Menus -> Repository / Restore Discarded changes
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.
I'm using Github Desktop for Windows v2.1.0 and I can confirm the trash/recycling bin doesn't exist any more. I'm using Windows 10.
In my case, the discarded change I wanted to undo was a deleted folder.
What solved it for me was to open the parent folder in Windows Explorer and do ctrl+z. This restored my deleted folder.
I got he same situation, just went to the Bin and the files were there. Just needed to replace the code manually again. My machine: Mac.
I went to Windows 'Recycle Bin' and found all my files.
Choose 'Restore' the files option of ‘Recycle Bin’ and then select 'Replace the file in the destination' option, all the changes should be back.
I had discarded the changes in the 'GitHub Desktop' still manage to restore it.
The discarded change is sent to the trash as a new file, with some variation of the original file's name. You can copy and paste the file in the trash to the original file.
For example:
I discarded a change to package.json
, and the resulting file in the trash was named package 16-36-10-974.json
. This file contained the original contents of the file before I discarded it. I copied the contents from package 16-36-10-974.json
to package.json
, and that's how I got the discarded changes back.
(not sure where the numbers in the file name come from)
I had this issue and it appeared that there was no way to restore these files using GitHub Desktop, my files were hosted on one of our servers but for some reason GitHub Desktop didn't move the files to the recycle bin as stated. Thankfully the server was backed up and I was able to restore the files that way.
I used Recuva and it worked.
Just install the app and select the folder that you need to recover, wait 2 mins
If you have ide open in which you coded, just undo changes by ctrl + z. All your discarded changes will be back.
You need to recover those files from the git repo
git fsck --unreachable --no-reflogs --no-cache HEAD
Or check it out this one:- restoring lost commits
© 2022 - 2024 — McMap. All rights reserved.