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

# Version Control

> Track changes and revert to previous versions

# Version Control

Every change in your Newly project is saved, giving you full version history and the ability to revert if needed.

## How It Works

Each time the AI makes changes to your code:

1. **Changes are made** - Files are created or modified
2. **Build completes** - App compiles successfully
3. **Commit created** - Changes are saved with a descriptive message
4. **Preview updates** - You see the result immediately

## Reverting Changes

If something breaks, you can revert to a previous version:

<Steps>
  <Step title="Open History">
    Navigate to the version history panel
  </Step>

  <Step title="Find Working Version">
    Look for the last commit where everything worked
  </Step>

  <Step title="Revert">
    Click the revert button on that commit
  </Step>

  <Step title="Confirm">
    Your project is restored to that state
  </Step>
</Steps>

## GitHub Sync

With GitHub connected, your version history is also:

* **Backed up** to your repository
* **Accessible** via standard Git tools
* **Shareable** with collaborators

<Card title="GitHub Integration" icon="github" href="/integrations/github">
  Learn about GitHub sync
</Card>

## Best Practices

<CardGroup cols={2}>
  <Card title="Test Before Moving On" icon="vial">
    Verify each change works before making more
  </Card>

  <Card title="Note Important Versions" icon="bookmark">
    Remember which commits represent major milestones
  </Card>

  <Card title="Revert Early" icon="clock-rotate-left">
    If something breaks, revert quickly rather than trying to fix forward
  </Card>

  <Card title="Read Commit Messages" icon="message">
    The AI's commit messages describe what changed
  </Card>
</CardGroup>

## Understanding Changes

### What Gets Committed

* Source code changes
* New files and assets
* Configuration updates
* Package dependency changes

### What Doesn't Get Committed

* Chat history (stored separately)
* Environment variables (stored securely)
* Build artifacts (regenerated each time)
