Let's say I have a git repo for my stuffs inside a directory myapp
:
myapp
/.git
/.gitignore
/subdirA
/subdirB
/file1.txt
/file2.txt
/(and some other stuffs)
/(and some other stuffs)
I want to view file1.txt
from an old commit abcd123
. For another thread, I learnt that I should use something like:
$ git show abcd123:path/to/file1.txt
However, I am confused about the right path to use. I've tried something like
$ git show abcd123:myapp/subdirA/subdirB/file1.txt
$ git show abcd123:subdirA/subdirB/file1.txt
$ git show abcd123:subdirB/file1.txt
$ git show abcd123:file1.txt
but git keeps giving me error messages like
$ Path 'subdirA/subdirB/file1.txt' does not exist in 'abcd123'
How to solve this problem?