git reset
discards any changes that you have, including everything that you put.
git clean -xdf
will get rid of anything in your working directory that git does not track due to ignore or exception.
git checkout HEAD
will put you without a branch so you can clear everything.
git branch | xargs git branch -D
will delete all your local branches
git tag -l | xargs git tag -d
will delete all your tags
git prune origin
get rid of any tracking branches that are no longer on the remote
git fetch
will receive any branches and tags from a remote computer that you donβt have. You can stop here and check out any remote branches you want to work on when creating a local branch using
git checkout origin/master
or you can create local branches indicating where all existing remote branches point to your selection with
git branch -r | xargs -n 1 git checkout
source share