How can I save my hardcore map after I die?

Solution 1:

As you probably know, hardcore mode is the same as hard mode but when you die your world is deleted.

When you die in hardcore mode you are given this game over screen.

Hardcore death screen

If you clicked the Delete world button your world is gone, kapoosh. But you might be in luck.

The can retrieve this is if you revert the saves folder to a previous version. To do this you have to locate your saves folder.

It can be found in the directory: %appdata%\.minecraft\saves

Once you have found the saves folder right click on it and select Restore previous versions. Select the latest version before you died and restore it.

Your world should return to its previous state, before you died.

Solution 2:

After dieing, choose to go into spectator mode instead of deleting the world (for obvious reasons). Then open the world to LAN and set cheats enabled to ON.

Run the command /gamemode survival.
Save and exit.

You should now be able to load your world again and you will be in survival mode, cheats will be disabled and your next death will be permanent (unless you follow these steps again).

Note: I tested this in 1.14.4, it may not work in previous versions