This document provides methods and materials for treating brain injuries. For example, methods and materials for using nucleic acid encoding a NeuroD1 polypeptide to convert reactive astrocytes within a brain (e.g., cerebral cortex) into functional neurons (e.g., neurons that can be functionally integrated into the brain of a living mammal (e.g., a human)) are provided.