Getting a previous version of a file

David Frey dpfrey at shaw.ca
Tue Jul 15 16:38:49 CDT 2008


On 7/15/2008, "Peter Arrenbrecht" <peter.arrenbrecht at gmail.com> wrote:

>On Tue, Jul 15, 2008 at 10:37 PM, Dean Schulze <dean_w_schulze at yahoo.com> wrote:
>>
>> This is a simple question, but none of the hg docs address it.
>>
>> How do I check out a previous version of a file?  hg update seems to only
>> want to work on entire directories.
>
>You cannot check it out in isolation. But you can use `hg cat` to list
>any specific version of a file. Or `hg cat -r therev thefile >thefile`
>to restore just one file to a previous revision. But it will be
>modified, then.
>-parren


I think "hg revert -r revNum FileName" is the standard solution to this
problem.



More information about the Mercurial mailing list