--

GIT clone a repository based on commit.

Assume that one of the files you needed were deleted accidently and already committed to the current branch and on top of that you had done several commits. However, still you need to get that deleted file.

First identify the commit that just prior to the deletion of the file.

Easy way is identify via GITLAB.

So it’s 91ae3305c61ce8803148dfcdc788ec5d2a6c7ecc

Then to a new location, clone the particular branch using GIT CLI.

git clone -b MybaranchName --single-branch https://github.com/Org/Project.git

Then type below command to get the branch in the commit.

git checkout 91ae3305c61ce8803148dfcdc788ec5d2a6c7ecc

Using this can get the branch in that commit.

--

--