diff --git a/README.md b/README.md index 74adace..83b272b 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ * [Don’t consider changes for tracked file.](https://github.com/git-tips/tips#dont-consider-changes-for-tracked-file) * [Undo assume-unchanged.](https://github.com/git-tips/tips#undo-assume-unchanged) * [Clean the files from `.gitignore`.](https://github.com/git-tips/tips#clean-the-files-from-gitignore) +* [Restore deleted file.](https://github.com/git-tips/tips#restore-deleted-file) @@ -503,5 +504,10 @@ git update-index --no-assume-unchanged git clean -X -f ``` +## Restore deleted file. +```sh +git checkout ^ -- +``` + diff --git a/tips.json b/tips.json index 382b103..fdd3138 100644 --- a/tips.json +++ b/tips.json @@ -288,5 +288,9 @@ { "title": "Clean the files from `.gitignore`.", "tip": "git clean -X -f" + }, + { + "title": "Restore deleted file.", + "tip": "git checkout ^ -- " } ]