Undo the last commits and keep them staged
CautionMoves the branch back by the given number of commits and keeps their changes staged for a new commit.
git reset --soft HEAD~2Edit the highlighted values, then copy. They are inserted as typed, without shell escaping.
Report an issue (opens in a new tab) wrong command, wrong danger level, typo… (on GitHub)
Adapted from tldr-pages (common/git-reset.md), licensed under CC BY 4.0.