There are three simple solutions to copy the last version that is in you remote repository, discarding all changes that you have made locally:
-
Discard your repository and clone again. This is the most simple solution, but if your repository is big, it can take a long time, and may require extra effort like re
configure
ing, etc. -
Discard the local changes with
git reset --hard <hash>
and then do agit pull
. The problem is you need to first find a commit that precedes whatever change history you are trying to avoid. After resetting to that commit hash, do agit pull
. -
Do a
git fetch
to bring the updates to your local reference of the remote branch (usually origin/master) and then do agit reset --hard
passing this reference, ie,git reset --hard origin/master
.