Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Undelete a file

After running git rm file, but before committing the change, you suddenly notice you don’t need to remove the file.

$ git rm file

$ git reset HEAD file
$ git checkout file