1
0
mirror of https://github.com/namibia/tips.git synced 2024-12-22 18:18:58 +00:00

Restore deleted file.

This commit is contained in:
Hemanth.HM 2015-12-27 19:08:25 +05:30
parent 8181a37dd1
commit 7078656d7c
2 changed files with 10 additions and 0 deletions

View File

@ -72,6 +72,7 @@
* [Dont 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)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
@ -503,5 +504,10 @@ git update-index --no-assume-unchanged <file_name>
git clean -X -f
```
## Restore deleted file.
```sh
git checkout <deleting_commit>^ -- <file_path>
```
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->

View File

@ -288,5 +288,9 @@
{
"title": "Clean the files from `.gitignore`.",
"tip": "git clean -X -f"
},
{
"title": "Restore deleted file.",
"tip": "git checkout <deleting_commit>^ -- <file_path>"
}
]