The process of restoring a degraded or damaged habitat to its original state or a functional equivalent.