File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 72
72
* [ Don’t consider changes for tracked file.] ( https://github.com/git-tips/tips#dont-consider-changes-for-tracked-file )
73
73
* [ Undo assume-unchanged.] ( https://github.com/git-tips/tips#undo-assume-unchanged )
74
74
* [ Clean the files from ` .gitignore ` .] ( https://github.com/git-tips/tips#clean-the-files-from-gitignore )
75
+ * [ Restore deleted file.] ( https://github.com/git-tips/tips#restore-deleted-file )
75
76
76
77
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
77
78
<!-- @doxie.inject end toc -->
@@ -503,5 +504,10 @@ git update-index --no-assume-unchanged <file_name>
503
504
git clean -X -f
504
505
```
505
506
507
+ ## Restore deleted file.
508
+ ``` sh
509
+ git checkout < deleting_commit> ^ -- < file_path>
510
+ ```
511
+
506
512
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
507
513
<!-- @doxie.inject end -->
Original file line number Diff line number Diff line change 288
288
{
289
289
"title" : " Clean the files from `.gitignore`." ,
290
290
"tip" : " git clean -X -f"
291
+ },
292
+ {
293
+ "title" : " Restore deleted file." ,
294
+ "tip" : " git checkout <deleting_commit>^ -- <file_path>"
291
295
}
292
296
]
You can’t perform that action at this time.
0 commit comments