After your Hero has been eliminated, you can purchase Hero Resurrection in Items store or Alliance store to revive him. Your Hero's XP and Levels will be transferred to your new Hero. If you don't revive your hero over 7 days, you have to hire a new one. Part of Hero's XP and Levels will be transferred to the new Hero, that depends on the level of the Hall of Heroes.