I accidentally lost a branch. I think this is in the reflog list, but it is too difficult to check everyone in it. I remember that a folder with some files was created in this branch, so it can be found by finding all the lost commits that affect the folder. So the question is: how can I find these commits?
I just need to specify the path in the reflog command. It is important to use a '-' in front of the path if the working tree is missing
git reflog -- path/to/the/affected/folder
You can run grep output git lstreeto find out about commits in a branch:
git lstree
for ID in `git reflog | cut -d' ' -f1` # filter out the commit ID do # show the tree for each commit and grep for the file there git ls-tree -r $ID | grep file/name && echo "File is on $ID" done
Source: https://habr.com/ru/post/1775636/More articles:Android: problem accessing Google tasks using OAuth - androidTkinter text widget will not fill / expand - pythonGNU Search: Search the current directory first - unixHow to get the amount of virtual memory in C ++? - c ++Python development for Mac - pythonДвухсторонняя привязка ASP.NET с помощью GridView и динамических шаблонов - asp.netFormula alternative that works well with mangoids - ruby-on-railsКак автоматизировать компиляцию модуля ядра Linux при установке нового ядра? - linuxA quick algorithm to find out if a string contains any string in a given array - c #Веб-хостинг говорит мне, что мне нужно добавить обработчики http для статического контента в мой web.config? - web-configAll Articles