Skip to content
2011-03-30 / gerdk

Back in Time (Mercurial command line tip #2)

To revert a file back to its status at a certain point in time use
hg revert --date yyyy-mm-dd HH:MM:SS <filename>

Example: to revert all files in the current directory back to the state as they were on 25th of March 2011, do this:

hg revert --date 2011-03-25 .

Note that hg understands quite a few date / time formats (hg help dates has a list) but I recommend to stick to ISO 8601 format as used above.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: