If you want to discard local changes , you must run git reset --hard @{u} . Please note that this is an irreversible action on some data, so it is mandatory before starting it. Here's how:
To find out what local commits you use, you can use git log HEAD --not --remotes to compare with any remote branch or git log @{u}..HEAD to see the differences specific to the tracked branch.
To see the actual diff that you made locally, run git diff @{u}... This ignores remote progress and only shows your changes.
To see uncommitted changes, run git diff HEAD .
PS: you must run git fetch origin or git remote update to update tracking links.
source share