In 3.5 edition, when a bag of holding is ruptured, RAW states that the contents are lost forever. Definitely harsh, but is it really absolute? Could a Wish spell still retrieve the lost items? Or would the wish spell instead be making new instances of the items from the lost bag of holding?
If cast fast enough Wish might be able to retrieve the bag wholesale if it was ruptured as the result of a single dice roll. Wish has the option of "Undo Misfortune", the items will then never have been lost.
Okay here's the conjecture/judgment part:
I'm ignoring the XP requirements, etc. for magic item creation for the sake of simplicity. If Wish is used to "restore" destroyed items from a irrevocably ruptured bag of holding it should be able to replace anything with a truly perfect replica, so much so that even divination spells that Wish can replicate shouldn't be able to tell the difference. A copy that perfect is, for almost all intents and purposes, the original.
The following fall under "trying to use a Wish to produce greater effects" so the effects are strictly speaking up to GM's discretion but I would suggest the following:
Items that Wish can't replicate because of material expense still appear perfect but the material has been adulterated to reduce the cost, Mithral replaced with a Silver-Mithral alloy of a lesser value, that sort of thing.
When it comes to the truly un-replicable, artifacts, their appearance is still perfect but their function is limited to the closest approach within the possibilities of Wish. PCs will need magic or bitter experience to prove the difference in these cases.
Do note that the value of material a Wish spell can create is a total so replacing the full contents of a well loaded bag of holding is probably out of reach.
Definitely yes, if “recent” and “misfortune”
Specifically, it it happened in the last round as the result of some roll, you can use wish to undo it:
- Undo misfortune. A wish can undo a single recent event. The wish forces a reroll of any roll made within the last round (including your last turn). Reality reshapes itself to accommodate the new result. For example, a wish could undo an opponent’s successful save, a foe’s successful critical hit (either the attack roll or the critical roll), a friend’s failed save, and so on. The reroll, however, may be as bad as or worse than the original roll. An unwilling target gets a Will save to negate the effect, and spell resistance (if any) applies.
So if someone was trying to stab your bag of holding, you could use wish immediately after to revert time and make them reroll, possibly failing to stab the bag.
Otherwise, purely up to the DM
While wish can definitely do certain, specific, listed things, it’s fundamentally an open-ended spell almost-purely up to the DM to decide whether or not, and how, it does things.
You may try to use a wish to produce greater effects than these [specific, listed effects such as undoing misfortune as quoted above], but doing so is dangerous. (The wish may pervert your intent into a literal but undesirable fulfillment or only a partial fulfillment.)
You could ask for a greater, more powerful attempt to undo misfortune, e.g. if it is because it was more distantly in the past or because it was not “misfortune” so much as a really bad decision, or whatever. But the rules-as-written only open up the possibility for this to work; they explicitly deny any guarantees and leave adjudicating it up to the DM.