Fetch all remotes:
git fetch --all
Overwrite all local files from branch:
git reset --hard remote/branch
for instance:
git reset --hard origin/master
Delete all merged branches except master
git checkout master
git branch --merged | grep -v '^* master$' | grep -v '^ master$' | xargs git branch -d