Want to change my master to an older commit, how can I do this?

If you want to do this and revert the master to the previous commit:

git checkout master~1            # Checkout previous commit on master
git checkout -b new_master       # Create branch for new master
git branch -D master             # Delete old master
git branch -mv new_master master # Make new_master master

Alternatively:

git reset --hard master~1        # Reset current branch to one commit ago on master

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)