MyTetra Share
Делитесь знаниями!
Restore a deleted file in a Git repo
Время создания: 16.01.2015 13:34
Текстовые метки: git
Раздел: root - Git
Запись: Yurons/mytetra/master/base/1421404471tftc10vuu2/text.html на

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.62
Яндекс индекс цитирования