I have a repository and it has LFS files. I want to retrieve a particular LFS tracked file from a previuos commit, without affecting the working directory.
In other words, if I were to retrieve a non-LFS file (simple text file) from a previous commit, without changing the current working directory in anyway, I could do this:
git ls-tree -l -r <commit_id> | grep some_file.txt
git cat-file blob <blob_id> > some_external_directory_path/some_file.txt # blob_id is obtained from the previous command's output
What can be the equivalent for an LFS file? Because in the above way, only the file with LFS SHA details is retrieved, not the actual file.