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

# Reset changes in workspace

> Resets uncommitted changes in a workspace by discarding modifications and optionally deleting added files.

**Parameters:**
- `all=true` - reset everything
- `paths` array - reset specific files
- `delete_added` (defaults to false) - controls whether newly added files are deleted
- `write_to_journal` (defaults to true) - records the reset operation

**Returns:**
Lists of:
- Succeeded paths
- Failed paths
- Skipped paths

**Requirements:**
Requires WRITE access.




## OpenAPI

````yaml post /repos/{repo_id}/workspaces/{workspace_id}/reset
openapi: 3.0.3
info:
  title: Diversion Core API
  description: >-
    Definition of the Core API used to access low-level functionality of
    Diversion
  version: 0.2.0
servers:
  - url: https://api.diversion.dev/v0
    description: Base endpoint
security: []
paths:
  /repos/{repo_id}/workspaces/{workspace_id}/reset:
    parameters:
      - $ref: '#/components/parameters/RepoParam'
      - $ref: '#/components/parameters/WorkspaceParam'
    post:
      tags:
        - Repository Workspace Manipulation
      summary: Reset changes in workspace
      operationId: src.handlersv2.workspace.reset
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                all:
                  type: boolean
                paths:
                  $ref: '#/components/schemas/PathsList'
      responses:
        '200':
          description: The updated status of the workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResetStatus'
        default:
          $ref: '#/components/responses/Error'
      security:
        - OAuth2:
            - coreapi/write
components:
  parameters:
    RepoParam:
      in: path
      name: repo_id
      required: true
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      description: >-
        The repo ID of the repository. Repo _name_ can be used instead of the
        ID, but usage of ID for permanent linking and API requests is preferred.
    WorkspaceParam:
      in: path
      name: workspace_id
      required: true
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      description: The repo ID of the workspace.
  schemas:
    PathsList:
      description: >-
        Inclusion list of paths to include in the operation. If null, all paths
        will be included.
      type: array
      nullable: true
      minItems: 1
      items:
        type: string
        description: A relative path to a file or directory inside the repository.
        minLength: 1
    ResetStatus:
      description: Response of a reset command.
      type: object
      properties:
        success:
          description: Paths that were successfully reset.
          type: array
          items:
            type: string
        fail:
          description: Paths that were not found.
          type: array
          items:
            type: string
      required:
        - success
        - fail
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
          example: 403
        detail:
          type: string
          example: User not authorized to perform the requested action on the resource
        title:
          type: string
        type:
          type: string
      required:
        - status
        - detail
  responses:
    Error:
      description: An error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    OAuth2:
      type: oauth2
      x-tokenInfoFunc: src.token_info.token_auth
      description: This API uses OAuth 2 with the implicit grant flow
      flows:
        implicit:
          authorizationUrl: https://auth.diversion.dev/oauth2/authorize
          scopes:
            coreapi/read: Operations with no possible side-effects
            coreapi/write: Modifying operations
            coreapi/admin: >-
              Organizational operations like adding a repo or changing repo
              properties

````