#restore
7 one-liners with this tag.
All one-liners tagged restore
Discard local changes to a file
$git restore wp-config.php
Extract a tar.gz archive without overwriting files
$mkdir -p /tmp/restore && tar -xzf /var/backups/example.com-httpdocs-2026-10-09.tar.gz -C /tmp/restore --skip-old-files
Import a gzipped dump into the WordPress database
$gunzip -c /var/www/vhosts/example.com/db-backup.sql.gz | wp db import - --path=/var/www/vhosts/example.com/httpdocs
Import a gzipped SQL dump into a database
$gunzip -c /var/www/vhosts/example.com/wp_example.sql.gz | mysql -u dbuser -p wp_example
Recover lost commits using the reflog
$git reflog --date=iso -n 30
Restore a single file from a tar backup
$mkdir -p /tmp/restore && tar -xzf /var/backups/example.com-httpdocs-2026-10-09.tar.gz -C /tmp/restore ./wp-config.php
Restore an accidentally deleted branch
$git branch feature/contact-form a1b2c3d