Last Updated: October 11, 2021
·
1.235K
· rvazquez

Revert All Local Changes in Git

You're coding. Everything is going well until disaster strikes. You try to fix the problem but every fix seems to take you down a path of interminable doom. You have to abandon ship.

Fear not. There is an easy way for you to revert all the changes that you've made to your local copy of the Git Repository. It goes like this:

git checkout ./

Boom. That's it. You can tell yourself every genius gets misguided sometimes; it's okay. Keep making magic.

Not everyone gets a second chance, you know?

1 Response
Add your response

@michd I knew about --hard but didn't know that it undoes staged changes. Thanks for the tip man!

over 1 year ago ·