Cy-près
Charitable gifts are made for purposes, and purposes can fail — the beneficiary class disappears, the need is met, the appeal raises too much or too little. Cy-près is how the law prevents the money simply being stuck.
Cy-près applies where the original purpose has become impossible, impracticable or no longer a suitable use of the property, and allows a scheme applying it to a similar purpose. The Charities Act 2022 simplified the position for failed fundraising appeals of small value.
This is not a self-help remedy — it normally needs the regulator. See changing your purposes, and failed appeals for the fundraising case.