Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Discard all changes at once using GitHub Desktop

Tags:

How can I discard all changes at once in GitHub Desktop? (I use it on Windows)

I used to do:

enter image description here

but can't see the option any more since GitHub for Windows upgraded itself silently (and changed its name to GitHub Desktop on the way).

I don't want to do it manually for each file one by one. I know I can use the git shell.

I use the latest version of GitHub Desktop, viz. 3.0.1.1.

like image 446
Franck Dernoncourt Avatar asked Aug 19 '15 07:08

Franck Dernoncourt


People also ask

How do I remove changes from GitHub desktop?

In GitHub Desktop, click Current Branch. At the top of the drop-down menu, click Pull Requests. In the list of pull requests, click the pull request you want to view. Optionally, to refresh the list of pull requests, click .

How do I discard all changes in git?

There are two Git commands a developer must use in order to discard all local changes in Git, remove all uncommited changes and revert their Git working tree back to the state it was in when the last commit took place. The commands to discard all local changes in Git are: git reset –hard. git clean -fxd.

How do I Uncommit a file in git desktop?

Super easy - Select your repository in the leftmost column and then click "Uncommitted Changes" in the 2nd column to display your changed files at the right. If you right-click on any file you'll have an option to "Discard changes".


2 Answers

I found it... now we need to right-click precisely on the "X changes" text in blue:

enter image description here


On GitHub Desktop for Mac v2.17: Menu Bar > Repository > Discard Changes to Selected Files.

enter image description here


Related issues:

  • Undo Discard Changes #861
  • Allow discarding of individual lines in a file #2402
like image 123
Franck Dernoncourt Avatar answered Oct 18 '22 23:10

Franck Dernoncourt


This ought to be just a comment, but I thought a screenshot of current looks might be useful. So to add to Franck's excellent answer:

enter image description here

like image 37
PatrickT Avatar answered Oct 18 '22 21:10

PatrickT