Git reset

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

 

 



Subscribe To Our Newsletter
You will receive our latest post and tutorial.
Thank you for subscribing!

required
required


Leave a Reply

Your email address will not be published. Required fields are marked *