FMeinicke's Wiki

Home

❯

Git

❯

undo last commit

undo last commit

May 26, 20251 min read

  • git/reset/soft
  • git/restore/staged

soft staged

Source

  • https://www.git-tower.com/learn/git/faq/undo-last-commit
git reset --soft HEAD~             # keeps the files staged
git restore --staged <files...>    # unstages the files
git restore <files...>             # restores the files to before the commit

Graph View

Created with Quartz v4.5.0 © 2025

  • GitHub