Looking at Old Versions
git show and git restore let you view or take old versions without moving branches.
Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
echo two > a.txt && git commit -qam 'second'
git show HEAD~1:a.txt
git log --format=%s -- a.txtResult
one second first
Exercise
File at old commit.
git show HEAD~1a.txt
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.