Rolling back a gist

Written politely 2020-10-17.

Don’t worry (…its easy) easy

First, a little background

If you use VSCode as your editor, there is a great extension that will allow you to back up all of your local settings using version control to a github gist so that you can sync your settings across machines.

If you have settings on one machine that is an older version of your settings and you push those settings up to the gist accidentally, all of the commits you made between the old version and the latest will be overwritten.

Don’t panic! The intent of this article is to show you how to fix it.

Copy the url for the gist

Visiting a url If you don’t have one already, copy this one.

Clone it in terminal

clone me

git clone https://gist.github.com/mshafrir/2646763

If you want to roll back to the previous commit

go back

git reset --hard HEAD~1

Push the commit up

Blue or red pill

git push -f

Now get back to whatever it is you were doing…

mansing


Lucas McDaniel

Husband, father, teacher, musician, avid gamer, nature enthusiast, and passionate about the human condition.