DEV Community

Discussion on: Which git commands do you struggle with?

Collapse
 
matthewsalerno profile image
matthew-salerno • Edited

revert has screwed me over a couple times. I think I get it now but it took a couple painful lessons to learn that it was not "revert back to this commit" but was actually "revert this commit and keep future commits." I ended up deleting my working commits and keeping my broken ones 😂🥲😭

Collapse
 
sagefright profile image
sagefright

Agreed, I recently went on a rant about revert and got it all out of my system.
twitter.com/AndyHails/status/15103...

Collapse
 
sandeshsapkota profile image
sandeshsapkota

do we have this command in git ! really ?

Collapse
 
matthewsalerno profile image
matthew-salerno

Yup the man page even tells me not to do exactly what I did. Although it's not as bad as I made it sound as it doesn't actually remove the commit, it just makes a new one that makes it as if the commit never happened.