git pull all commit except last one code example Example: disregard incoming git pull and return to last commit git reset --hard HEAD