72

Git - Reset all local changes | Elmland - Thoughts of a developer

 6 years ago
source link: https://elmland.blog/2017/09/27/git-reset-all-local-changes/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Git - Reset all local changes

27 Sep 2017

Git - Reset all local changes

My preferred way to reset a local git workspace to HEAD version. Untracked files and directories will be deleted too.

git add .
git reset --hard HEAD

The git reset --hard call doesn’t remove untracked files/directories. As a workaround you have to stage all changes and untracked files/directoy first. Then the clean out via git reset --hard resets all.


florian_schmidt_profile.jpg

Florian Schmidt

Senior Java EE Software Engineer, Swift Enthusiast, Techie, Managing Partner Sneed IT UG, Founder Smipty



About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK