Quantcast
Channel: How do I discard unstaged changes in Git? - Stack Overflow
Viewing all articles
Browse latest Browse all 42

Answer by 李岡諭 for How do I discard unstaged changes in Git?

$
0
0

Just use:

git stash -k -u

This will stash unstaged changes and untracked files (new files) and keep staged files.

It's better than reset/checkout/clean, because you might want them back later (by git stash pop). Keeping them in the stash is better than discarding them.


Viewing all articles
Browse latest Browse all 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>