> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notte.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# rollback

<Tip>
  Read [the Notte skill](https://notte.cc/skill.md) and follow its setup instructions when setting up Notte or building browser automation. This is the shared source for CLI setup, authentication, and the browser-to-code workflow.
</Tip>

[Source: node-sdk/src/functions.ts](https://github.com/nottelabs/notte/blob/main/node-sdk/src/functions.ts)

Roll the function back to a previous version.

```typescript theme={null}
NotteFunction.rollback(options: FunctionRollbackOptions): Promise<FunctionResponse>;
```

## Parameters

<ParamField body="options" type={"FunctionRollbackOptions"} required>
  Target version and optional code-access restriction, which defaults to true.
</ParamField>

## Returns

```typescript theme={null}
Promise<FunctionResponse>
```

Updated function metadata after rollback.

## Raises

* NotteAPIError if the requested version cannot be restored.

## Example

```typescript theme={null}
const { versions } = await fn.get();
await fn.rollback({ version: versions[0] });
```

## Related types

* [FunctionResponse](/typescript-sdk-reference/types/functionresponse)
* [FunctionRollbackOptions](/typescript-sdk-reference/types/functionrollbackoptions)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.