DEV Community

Cover image for git reset --explain

git reset --explain

konrad_126 on January 08, 2019

Reset is probably one of the least understood git commands with the addition of having a bad reputation for being dangerous. There is a valid reaso...
Collapse
 
mariocd10 profile image
Mario DeLaPaz

Very well written post. I found it easy to follow and understand. I myself had trouble fully understanding what reset --hard did, instead I would just follow the instructions of the SO answers and forum posts that just told me to do it.

The more I use and understand git, the easier it gets.

Collapse
 
jessekphillips profile image
Jesse Phillips • Edited

I found two dangerous commands.

  • git reset --hard
  • git clean

All other commands can be run and git will stop if unsaved changes would need to be changed until force is used.

Even clean is only dangerous if you configure it to be and if you're using it force might be a habit

Collapse
 
dcouvering profile image
David Van Couvering

Hey, Konrad, thanks for this! You explain things very very well, with great graphics. I tried to follow your link to your Understanding Git series and got a 404. Can I find it anywhere?

Collapse
 
konrad_126 profile image
konrad_126

Hi David,

The link was broken, I've edited it in the article. This is where it leads now:
medium.com/hackernoon/https-medium...

Thanx for the heads up and I'm glad you liked the article!

Collapse
 
venoel profile image
venoel

Clear explanation!

Collapse
 
andreacolangelo profile image
Andrea Colangelo

Really great post. Clear, concise and straight to the point. Well done!