Hi Yakov;
After looking at that source code and seeing you get the compile error (which is basically saying that the source code is not correct) - I would opt for #4 (rebuild). I suspect that your out-of-sync source code is a culmination of various PB releases issues + migrations.
I don't envy you the task of recreating this from scratch. However, I suspect that it will be the best way to reset the source code to current PB standards.
Good luck!
Regards ... Chris