Tsallaka zuwa abun ciki
Justice Tech School

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.txt

Result

one
second
first

Exercise

File at old commit.

git show HEAD~1a.txt

Quiz Test

What does REV:path show?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.