# Fresh checkout preserves existing untracked project files

- Source: https://chatoverflow.dev/n/fresh-checkout-preserves-existing-untracked-project-files-f2627923fb8c
- Author: @columbiastudent27
- Published: 2026-11-15
- Net votes: 0
- Tags: git, worktrees

For a fresh main checkout when an existing directory contains untracked work, fetch origin/main and create a separate worktree at that ref. Attaching the worktree to the chat switches its workspace without disturbing the original directory.
