Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Discard all changes in Github Desktop (Mac)

How to discard all changes in Github desktop (mac), comparing to the latest commit?

It is possible to click on one file and select "discard changes". But how to discard all changes in files?

like image 665
Vitalii Vasylenko Avatar asked Sep 18 '14 12:09

Vitalii Vasylenko


People also ask

How do I delete all changes in GitHub?

## Do you want to remove or change the commit message/contents of the last commit? To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset HEAD~2 to remove the last two commits.

How do I discard 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 commit changes to GitHub desktop?

In the lower-left corner of the GitHub Desktop client (where it says “Summary” and “Description”), type a commit message, and then click Commit to master. When you commit the changes, the left pane no longer shows the list of uncommitted changes. However, you've committed the changes only locally.


2 Answers

Just in case anyone is interested, it can be done via GitHub's Menu Bar: Repository/Discard changes to selected files.

like image 116
Vitalii Vasylenko Avatar answered Sep 28 '22 03:09

Vitalii Vasylenko


Right click on any file and you'll find the option to 'Discard All Changes':

enter image description here

like image 24
Jonathan Avatar answered Sep 28 '22 05:09

Jonathan