Automatically create redirect for a file when the file is renamed?
Using hook_node_presave get the url of the old one (foo.pdf) and the new url of the new one (foo_0.pdf) and then create a new redirect as shown by 4k4 here.

To get the orignal value (ex: title), I know in D7 you can with $node-&gt;original-&gt;title not sure if this still works on D8, have not yet tried it. 

Also, since your url ends with .pdf I am not sure if this will work, but hopefully it will.