Sign in
Log inSign up

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!)

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct