Second, a retaining wall must have properly compacted backfill. Backfill refers to the dirt behind the wall. In order to provide proper drainage, at least 12 inches of granular backfill (gravel or a similar aggregate) should be installed directly behind the wall. Compacted native soil can be used to backfill the rest of the space behind the wall.