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.
Advertisement
