MyTetra Share
Делитесь знаниями!
О, смотри-ка какое хорошее место. Дайте два!
Restore a deleted file in a Git repo
16.01.2015
13:34
Текстовые метки: git
Раздел: root - Git

Find the last commit that affected the given path. As the file isn't in the HEAD commit, this commit must have deleted it.

git rev-list -n 1 HEAD -- <file_path>

Then checkout the version at the commit before.

git checkout <deleting_commit>^ -- <file_path>

Or in one command, if $file is the file in question.

git checkout $(git rev-list -n 1 HEAD -- "$file")^ -- "$file"

Так же в этом разделе:
  • link
  • Restore a deleted file in a Git repo
← Содержание ...
 
MyTetra Share v.0.35
Яндекс индекс цитирования