Git reset

June 7, 20191 min readUpdated 1/20/2021

Get list of commits to choose from

git log

 

Git reset can change the branch pointer to point to any commit in the tree.

git reset --hard <hash>
$ git reset --hard 07a2a46

HEAD is now at 07a2a46 Updated index.html

If you quickly check the log, you will see no history of the commits after 07a2a46

Update branch on remote 

git push

or 

git push origin HEAD --force