Forrest logo
back to context overview

git-reset

List of commands for git-reset:

  • git-reset:tldr:71b93 git-reset: Discard any uncommitted changes, staged or not (for only unstaged changes, use `git checkout`).
    $ git reset --hard
    try on your machine
    explain this command
  • git-reset:tldr:8815b git-reset: Unstage everything.
    $ git reset
    try on your machine
    explain this command
  • git-reset:tldr:c6f07 git-reset: Reset the repository to a given commit, discarding committed, staged and uncommitted changes since then.
    $ git reset --hard ${commit}
    try on your machine
    explain this command
  • git-reset:tldr:ce8b7 git-reset: Unstage specific file(s).
    $ git reset ${filename1 filename2 ---}
    try on your machine
    explain this command
  • git-reset:tldr:fa302 git-reset: Undo the last two commits, adding their changes to the index, i.e. staged for commit.
    $ git reset --soft HEAD~2
    try on your machine
    explain this command
  • git-reset:tldr:fb527 git-reset: Interactively unstage portions of a file.
    $ git reset --patch ${filename}
    try on your machine
    explain this command
back to context overview