I endowed (waqf) a piece of land for a graveyard, and then I came to need it.
It is not permissible for you to take back any part of the land you have endowed, because it has left your hand and passed to the beneficial purpose for which you endowed it. If it can be used for burial there, that is better; otherwise it should be sold and, with its price, another piece of land bought in its place and made into a graveyard.
This transaction should be carried out through the judge of the place where the land was endowed. Hope for the reward from Allah; He will give you a better replacement for what you have spent.