DEV Community

Discussion on: 10 useful Git tips to improve your workflow

Collapse
 
z2lai profile image
z2lai • Edited

Good tips!

I think #10 might be wrong though, doesn't git reset --hard head undo and permanently remove all changes of the last commit. If so, this command should also come with a warning to be sure you know what it does.

The --soft flag on the other hand undoes the last commit but keeps the changes in working directory or staging.

I think the command you were meaning to say is git checkout -- . which discarded all changes in the working directory.