My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How do you clean uncommitted changes in your git repos?

Sai Kishore Komanduri's photo
Sai Kishore Komanduri
·May 15, 2017

I'm addicted to git stash && git stash drop as a quick way to bring my repo. to a clean state. I am curious to know what is your way of doing this?

TIL checkout takes a <path> as an argument which you can use to go back to the "clean" state of the given <path>.

So, you can use git checkout . to remove all uncommitted changes in all the files (This will not have any effect on untracked files, though!)