checkout remote
git fetch
git checkout test
glv
git reset –hard HEAD
git clean -xffd
git pull
Or you can use the commands below:
git reset –hard # removes staged and working directory changes
## !! be very careful with these !!
## you may end up deleting what you don’t want to
## read comments and manual.
git clean -f -d # remove untracked
git clean -f -x -d # CAUTION: as above but removes ignored files like config.
git clean -fxd :/ # CAUTION: as above, but cleans untracked and ignored files through the entire repo (without :/, the operation affects only the current directory)
source:
http://stackoverflow.com/questions/1090309/git-undo-all-working-dir-changes-including-new-files
===============
git check out remote
checkout remote
git fetch
git checkout test
glv
git reset –hard HEAD
git clean -xffd
git pull