Minecraft, and how do i install it back? [duplicate]

This is a quirk that you sometimes get on the App Store. Usually, you can just press buy again, and after you enter your password, it tells you something like:

You have already brought this product and will not be charged again.

However, if you don't want to risk it, you can either: check the "Purchased" tab, anything you download of the Purchased tab should be free, as you own it, or, you could download your purchases onto iTunes, and then sync them on to your device.