Sometimes, during the testing it is needed to update local code with the recent changes of some GIT branches, ignoring local changes (overwriting them).
In my case, I am creating the code on one machine, but testing (multiple tiles) on another.
Long story short:
git fetch --all && git reset --hard origin/LOCAL-BRANCH && git clean -f -d && git pull
Or, to auto-detect the current branch:
git fetch --all && git reset --hard origin/`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` && git clean -f -d && git pull
Photo by Brett Jordan on Unsplash