If the accusatory pleading in any criminal action has heretofore been lost or destroyed or shall hereafter be lost or destroyed, the court must, upon the application of the prosecuting attorney or of the defendant, order a copy of such pleading to be filed and substituted for the original, and when filed and substituted, as provided in this section, the copy shall have the same force and effect as if it were the original pleading.