# GH_UndoServer class

Namespace: [Grasshopper.Kernel.Undo](https://developer.rhino3d.com/api/gh1/namespace/grasshopper.kernel.undo.md) · Assembly: [Grasshopper](https://developer.rhino3d.com/api/gh1/assembly/grasshopper.md)

```cs
public class GH_UndoServer : IGH_DebugDescription
```

Provides access to a documents undo data.

## Constructors

- [GH_UndoServer](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/ctor.md)

## Properties

- [FirstRedoName](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/firstredoname.md): Gets the name of the last item in the redo stack (the first item to be redone).
- [FirstUndoName](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/firstundoname.md): Gets the name of the last item in the undo stack (the first item to be undone).
- [MaxRecords](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/maxrecords.md): Gets or sets the maximum number of undo records that can be stored.
- [RedoCount](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/redocount.md): Number of redo records currently in the stack.
- [RedoGuids](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/redoguids.md): Gets a sorted list of all the redo Guids in this server.
- [RedoNames](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/redonames.md): Gets a sorted list of all the redo Guids in this server.
- [UndoCount](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/undocount.md): Number of undo records currently in the stack.
- [UndoGuids](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/undoguids.md): Gets a sorted list of all the undo Guids in this server.
- [UndoNames](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/undonames.md): Gets a sorted list of all the undo Guids in this server.

## Methods

- [AppendToDebugLog](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/appendtodebuglog.md)
- [Clear](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/clear.md): Clear both undo and redo lists.
- [ClearRedo](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/clearredo.md): Clear the undo list.
- [ClearUndo](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/clearundo.md): Clear the redo list.
- [MergeRecords](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/mergerecords.md): Attempt to merge the N most recent records into one. The name of the merged record will be identical to the name of the oldest record.
- [PerformRedo](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/performredo.md): Performs a single Redo step if possible and migrates the record onto the undo stack. This function may throw all kinds of exceptions, if you're calling it from a UI thread, use a Try..Catch block to prevent crashes.
- [PerformUndo](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/performundo.md): Performs a single Undo step when possible and migrates the record onto the redo stack. This function may throw all kinds of exceptions, if you're calling it from a UI thread, use a Try..Catch block to prevent crashes.
- [PushUndoRecord](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/pushundorecord.md): (2 overloads) Add a new undo record to the undo stack, this function clears the Redo stack.
- [RemoveRecord](https://developer.rhino3d.com/api/gh1/type/grasshopper.kernel.undo.gh-undoserver/removerecord.md): Remove the record with the specified ID from the undo or redo stack.
