DEV Community

Marcus Rådell
Marcus Rådell

Posted on

Oh shit, git!

Here's a quick tip to get back on track if you ever get stuck as a beginner:

0 Quick save

Copy your local repo folder to somewhere else. Worst case, and you can restore everything.

1 Resetting

Assuming you are on the main branch; git add . && git reset --hard origin/main will remove all local file changes and reset your main branch.

Top comments (0)