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?
## 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.
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.
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.
Just in case anyone is interested, it can be done via GitHub's Menu Bar: Repository/Discard changes to selected files.
Right click on any file and you'll find the option to 'Discard All Changes':
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With