Restore Command Options
Therestore command restores .env* files from a previous backup. When no timestamp is provided, the most recent valid backup will be automatically selected.
Command Usage
Arguments
- timestamp (optional): Specific backup timestamp to restore (format: YYYYMMDD-HHMMSS). If omitted, the most recent backup will be used automatically.
Options
Skip confirmation prompt and proceed with the restore operation automatically.Aliases:
-yExample:List all available backups without performing a restore. Shows both valid and invalid backups with their details.Example:
Preserve original file permissions when restoring files. This ensures that file access rights are maintained.Example:
Preserve original file timestamps (modified and access times) when restoring files.Example:
Create a pre-restore snapshot before performing the restore operation. This enables rollback capability if the restore fails.Aliases:
--rollbackExample:Force restore without checking for changes in the current working directory. Skips file change detection.Aliases:
-fExample:Show what would be restored without making any actual changes. Perfect for previewing the restore operation.Aliases:
--simulateExample:Enable verbose logging with detailed information about the restore process. Useful for debugging and monitoring.Aliases:
-VExample:Enhanced Features
The restore command includes several advanced capabilities:- Automatic backup discovery: Finds and selects the most recent backup when no timestamp is provided
- Backup validation: Checks backup integrity before restoration
- Rollback capability: Automatic recovery if restoration fails (when
--create-rollbackis used) - Cross-platform compatibility: Works seamlessly on Windows, macOS, and Linux
- Progress tracking: Real-time feedback during restoration
- Comprehensive logging: Detailed operation logs for debugging
Usage Examples
Restore Most Recent Backup
Restore Specific Backup
Restore Without Confirmation
List Available Backups
Preview Restore (Dry Run)
Verbose Restore
Advanced Restore with Rollback
Force Restore
Backup Timestamp Format
Backup timestamps follow the formatYYYYMMDD-HHMMSS:
YYYY: 4-digit yearMM: 2-digit monthDD: 2-digit dayHH: 2-digit hour (24-hour format)MM: 2-digit minuteSS: 2-digit second
20241125-143022 represents November 25, 2024 at 14:30:22