I ran into the situation where I had a directory tree restored from backup but the permissions were all messed up. The directory with the corrupted files still existed and the permissions there were intact.
So the idea was to sync the permissions of the one directory tree to the other. I found the solution to my problem in this Serverfault thread.
The way this works is to read the permissions recursively with getfacl, store the result in a file, change the path with sed and then run setfacl with the file as input.