mkdir commadir
cd commadir
git init
echo "dog" >> dog.txt
git add .
git commit -m one
echo "dog" >> dog.txt
git add .
git commit -m two
echo "dog" >> dog.txt
git log
git checkout dog.txt
cat dog.txt
how many dogs in dog.txt?
cd commadir
git init
echo "dog" >> dog.txt
git add .
git commit -m one
echo "dog" >> dog.txt
git add .
git commit -m two
echo "dog" >> dog.txt
git log
git checkout dog.txt
cat dog.txt
how many dogs in dog.txt?
I can certainly understand the danger/confusion there, though. Using checkout on a file reverts the file to a committed state. But the grandparent was referring to checking out a branch, not a file, which is safe.
has the same behaviour. does it not? I left out the asterisk as I was working from memory.