If you want to revert all changes AND be up-to-date with the current remote master (for example you find that the master HEAD has moved forward since you branched off it and your push is being ‘rejected’) you can use:
# will fetch the latest changes on the remote git fetch # will set your local branch to match the representation # of the remote just pulled down. git reset --hard origin/master
Also you can revert some changes simply using this checkout command:
git checkout .