Skip to main content

undo

Function undo 

Source
pub fn undo(source: &Path, backup_dir: &Path, count: usize) -> Result<()>
Expand description

Restore the doing file from the Nth most recent unconsumed backup (1-indexed).

Before restoring, a consumed snapshot of the current source is created so that redo can reverse the undo. The restored backup and all newer backups are also marked as consumed (renamed from .bak to .undone) so that subsequent calls walk backwards through history. Returns an error if fewer than count unconsumed backups exist.