2
If you want to keep the last commit changes (they stayed in the Stage)
git reset --soft HEAD^
If you prefer to discard them
git reset --hard HEAD^
You can also tell the commit hash you want to point to
git reset --<soft|hard> 2c593e
See more details in the documentation of git reset
In case I want to rule it out, but --hard it removes only the first, is that it? And then in case it would be the day 27 at 14:11 ?
– Romulo Sousa
@Romulosousa What says is the first is the
HEAD^
which means "go to the commit that’s right behind HEAD"– Jéf Bueno
I understood, for me it would decide to use the commit
2c593e
, soft would work. Just one question with that it would delete the commit that was wrong?– Romulo Sousa
The two remove the commit. The difference is that the hard kills the modifications, you lose them. The soft keeps modifications in the Stage area.
– Jéf Bueno
Note that this will not change the remote repository, only the location.
– Jéf Bueno
@Romulosousa About the options of
git reset
, see here: https://answall.com/q/325951/112052– hkotsubo