Learn Git Lesson gives incorrect definition of soft and medium resets
See original GitHub issueDescribe the Issue
There’s a definition in a Relational Database Learn Git lesson that is not strictly correct. This instruction is given:
I’m going to show you a few ways to remove or undo a commit. The first is to simply “travel back in time”. You can use the
git reset
command to travel to any point in your commit history. Your currentHEAD
is a reference to the last commit you just made. Usegit reset HEAD~1
to go back one beforeHEAD
.
The problem is the next instruction which says:
This is a “soft” reset and will put the changes from the commit you undid in your working tree. You can see that it says there’s unstaged changes after the reset to your file…
This was not a “soft” reset. This was a “medium” reset. --medium
is the default. --soft
would leave changes in the staging area.
The original author probably indended “soft” meaning “not hard” but “soft” has a very specific meaning here.
Affected Page
Your code
git reset HEAD~1
Expected behavior
I expect to be taught that git reset HEAD~1
is equivalent to git reset --medium HEAD~1
, NOT git reset --soft HEAD~1
as the lesson suggests
Screenshots
No response
System
- Device: HP laptop
- OS: 5.18.0-kali7-amd64
- Browser: Chrome
- Version: Latest
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:8 (7 by maintainers)
Top GitHub Comments
@nayabatir1 My PR have been merged. I think this issue will soon be closed.
PR: https://github.com/freeCodeCamp/learn-git-by-building-an-sql-reference-object/pull/15