From: Junio C Hamano Date: Tue, 03 Feb 2009 06:34:25 GMT Subject: Re: how to diff versions of a file Message-ID: <7vk588do5q.fsf@gitster.siamese.dyndns.org> In-Reply-To: david@lang.hm writes: > I don't think it's trivial I think you meant to say it _is_ trivial. > If you just wanted three commits ago you could do > > git diff HEAD..HEAD^^^ tree.c That would give you a reverse diff; I think you probably meant the other way around, "git diff HEAD~3 HEAD tree.c". > but three changes to tree.c ago I think you need to do multiple > iterations of git blame to find out what commit was three edits ago. git diff $(git rev-list -3 HEAD -- tree.c | sed -n -e '$p') HEAD -- tree.c This assumes that the history is linear but your statement "three edits ago" already assumes that, so...