git diff HEAD 'HEAD@{3 weeks ago}' -- some/file/path/file.ext
This is not, strictly speaking, the revision made three weeks ago. Instead, it's the position HEAD
was at three weeks prior to the present. But it's probably close enough for your purposes - it will be very accurate if the current branch's HEAD
moved forward steadily, as most tend to do. You can improve the accuracy by using a branch name instead of HEAD
.
Instead of an offset-from-the-present, you can also use a date/time, like HEAD@{1979-02-26 18:30:00}
. See git help rev-parse
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…