How to discard all changes made to a branch?
git reset --hard can help you if you want to throw away everything since your last commit
Note: You CANNOT UNDO this.
Try git checkout -f
this will discard any local changes which are not committed in ALL branches and master.
git diff master > branch.diff
git apply --reverse branch.diff