How to return my working directory to the state in which it would be if I made a new clone and check the current version?
For subversion, I would do:
$ svn status --no-ignore | awk '$1 == "?" { print $2 }' | xargs rm -r
and for mercury:
$ hg status --ignored --unknown | awk ' ( $1 == "?" ) || ( $1 == "I") { print $2 }' | xargs rm -r
So the answers in one line are beautiful. But something like git checkout --clean -r b4a23 would be better.
source share