You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The instruction block from the website is screenshoted below.
I just ran into such situation right now. While the approach itself is good, this can completely delete newly created files and there would be almost no options to restore them.
I think you should consider deleting this block from the site in favor of always doing git reset HEAD~ --soft because it's more safe. I think plenty of people have lost their changes thanks to you. Don't advise people to do so, this is harmful advise. Or you should at least mention this in red and CAPS ON.
Should be always superseded with (because it's more safe):
The text was updated successfully, but these errors were encountered:
I would suggest a cleaner solution of keeping the original instructions, but replacing --hard with --keep which is the safer version of hard that aborts if you have any local changes that would be lost.
Doing this would avoid the danger of loosing un-commited changes, but still keep the relatively simple 3-step workflow described.
Relevant snippet from git help reset:
--keep
Resets index entries and updates files in the working tree that are different between <commit> and
HEAD. If a file that is different between <commit> and HEAD has local changes, reset is aborted.
The instruction block from the website is screenshoted below.
I just ran into such situation right now. While the approach itself is good, this can completely delete newly created files and there would be almost no options to restore them.
I think you should consider deleting this block from the site in favor of always doing
git reset HEAD~ --soft
because it's more safe. I think plenty of people have lost their changes thanks to you. Don't advise people to do so, this is harmful advise. Or you should at least mention this in red and CAPS ON.Should be always superseded with (because it's more safe):
The text was updated successfully, but these errors were encountered: