tags:

views:

67

answers:

1

I want to get the current head of my git repo destroying all changes made and erasing additional files in the working copy.

+1  A: 

I think that you are looking for something like this. Be careful! This potentially erases things that you cannot get back.

git reset --hard

git clean -fx
Charles Bailey
cool, that did the trick, go to make an alias for this.
Jan Limpens
You can use -e on git-clean if theres a specific file you don't want to erase. If I recall, it can't be safely used with -x though (I believe it has no effect in that case). (This may only be in `master` of git.git though)
mathepic
You might want to add the `-d` option to `git clean` - that'll make it remove whole untracked directories, which otherwise it'd ignore. You also might not always want to delete ignored files (`-x`).
Jefromi