I have an approximately 1TB directory with subdirectories dir1. I have made an rsync backup copy dir1.back.How can I efficiently restore dir1 to the state of dir1.back - that is, replace files in dir1 with those of dir1.back if they've change and deleting any new files in dir1? Given its large size, cp/rsync of the entire dir1.back is highly infeasible.If I'm not mistaken, this might be possible using rsync --check-sum?
Restore directory to previous state
rsync;backup;file copy
Reverse the RSYNC. So swap around dir1 and dir1.back then add the delete flag to ensure it removes files as appropriate to make sure it properly syncs and not just ignore files that weren't present in dir1 originally.rsync -avz --delete dir1.bak/ dir1/