The solution by SKevo is probably the best one but here are some other possible options that can help depending on the situation:
It's unusual to mess up the files in vendor
unless manually editing them (which you shouldn't do), but if that happened, you can just delete the vendor
folder and run composer install
to re-install all the files like they were.
To copy a fresh version of all Flarum and extension files in public
, you can run the php flarum assets:publish
command. This also happens automatically after the Flarum installation and whenever you enable an extension.