I literally raged quit because this happened to me whilst fighting off a ghost levihitan in the lost River. When I realised 90% of my lockers are gone, I've already saved the game and could not get back all the lost materials within those jettisoned lockers.
You can use some commands to get what you had back like "nocost" (build everything for free) or "item " (place the object in your inventory, the list is on the wiki). If you care about achievements and you are on PC, I know there is a mod that will unlock them even after the usage of commands.