<?php
/**
 * NFT Backup Restore
 * Run this once to restore files from .bak-nft-20260606-114806
 * Delete this file after running.
 */

$backup_dir = __DIR__ . '/.bak-nft-20260606-114806';

if ( ! is_dir( $backup_dir ) ) {
    die( "Backup directory not found: $backup_dir\n" );
}

$files = [
    'admin/views/recipe-edit.php',
    'admin/views/recipe-print.php',
    'admin/assets/admin-common.css',
];

foreach ( $files as $rel ) {
    $src  = $backup_dir . '/' . basename( $rel );
    $dest = __DIR__ . '/' . $rel;
    if ( file_exists( $src ) ) {
        copy( $src, $dest );
        echo "Restored: $rel\n";
    } else {
        echo "Skipped (not found in backup): $rel\n";
    }
}

echo "\nDone. Files restored from backup.\n";
