discard local changes and pull code example Example: git pull master discard local changes git reset --hard origin/master git pull origin master