Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I undo discard changes in GitHub Desktop?

Is there any way to undo discard changes in GitHub Desktop, after the Undo button has disappeared?

enter image description here

I am talking about GitHub Desktop's undo feature, not git in general.

like image 406
Franck Dernoncourt Avatar asked Feb 22 '16 05:02

Franck Dernoncourt


People also ask

Can you undo git discard?

Nothing in Git is deleted, so when you work in Git, you can undo your work. All version control systems have options for undoing work.

How do you undo discard all changes in git?

Ctrl + Z or restore from trash. I have lost work to this multiple times, and to remedy this, I commit all the changes, then reset the branch to the previous commit. Then you can run git discard to discard the changes, but keep a reference in the reflog.


1 Answers

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:

enter image description here

like image 173
chrismarx Avatar answered Sep 20 '22 23:09

chrismarx