Jason S
Jason S

Reputation: 189646

How to retrieve (but not overwrite local copy) of an older file in mercurial?

I have a local Mercurial repository that is up-to-date. I want to retrieve an earlier version of one of the files without disturbing my local copy of the repository.

Is there a way to do this? (looks like maybe hg archive but I'm not sure how to use it)

Upvotes: 1

Views: 169

Answers (2)

Theo Belaire
Theo Belaire

Reputation: 3020

The most common way to look at a previous revision of a file would be with hg update -r <revision number> to update your working directory to that revision, then to look at the file. If you really don't want to touch your working directory, clone your repo, then use hg update on the clone.

Upvotes: 0

Ted Naleid
Ted Naleid

Reputation: 26791

hg cat -r <rev> file_name.foo > new_file_name.foo

Upvotes: 5

Related Questions