---
title: restoreGState()
framework: coregraphics
role: symbol
role_heading: Instance Method
path: coregraphics/cgcontext/restoregstate()
---

# restoreGState()

Sets the current graphics state to the state most recently saved.

## Declaration

```swift
func restoreGState()
```

## Discussion

Discussion Core Graphics removes the graphics state at the top of the stack so that the most recently saved state becomes the current graphics state.

## See Also

### Saving and Restoring Graphics State

- [saveGState()](coregraphics/cgcontext/savegstate().md)
