'Git soft reset following revert deleted files changes
I wanted to undo a commit, using IntelliJ I right-clicked on the last commit and then clicked "Revert Commit". A message told me no changes were made. By looking at the command log the command was:
revert 75d72c1c0746b225d3857 --no-commit
The reverted changes appear in the changelist (or in the staged files area using sourcetree). I realized it wasn't the correct command to do what I needed, so I used:
reset --soft HEAD^
The last commit was eliminated, but the edited files did not appear in the changelist. It was as if I executed a reset --hard.
I managed to recover changes in another way, but I don't understand why the soft reset acted as a hard reset.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
