# UpdateTerrainDataUndo(TerrainData, string)

> Updates the undo stack with a terrain operation.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.TerrainTools](/engine/6000.7/script-reference/unityeditor/terraintools.md)
* **Assembly:** UnityEditor

```csharp
public static void UpdateTerrainDataUndo(TerrainData terrainData, string undoName)
```

### Parameters

**** (\[TerrainData]\(/engine/6000.7/script-reference/unityengine/terraindata)): Terrain data object.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the undo operation.

### Remarks

This method adds a new terrain operation to the undo stack, so the operation can be undone and revert the terrain's data to its previous state.
