zed-industries/zed · error

Failed to restore `{name}`. Something already exists at its

Error message

Failed to restore `{name}`. Something already exists at its original location.

What it means

Raised by the undo system's restore: Project::restore_entry failed with TrashRestoreError::AlreadyExists — something (a file or directory) now occupies the item's original path, so the trashed item cannot be put back. The message includes the item's display name.

Source

Thrown at crates/project_panel/src/undo.rs:860

                        path: relative_path.into_arc(),
                    })
                })();

                Some(project_path.map_or(original_name, |project_path| {
                    project_path_display(project, &project_path, path_style, cx)
                }))
            })
            .unwrap_or_else(|| "item".to_string());

        workspace
            .update(cx, |workspace, cx| {
                workspace.project().update(cx, |project, cx| {
                    project.restore_entry(worktree_id, trash_id, cx)
                })
            })
            .await
            .map_err(|err| match err.downcast_ref::<TrashRestoreError>() {
                Some(TrashRestoreError::Collision { .. }) => anyhow!(
                    "Failed to restore `{name}`. Something already exists at its original location."
                ),
                _ => anyhow!("Failed to restore `{name}`. It may have been permanently deleted."),
            })
    }

    /// Displays a notification with the provided `title` and `error`. The
    /// `error` is rendered as markdown, so file names wrapped in backticks show
    /// up as inline code.
    fn show_error(
        title: impl Into<SharedString>,
        workspace: WeakEntity<Workspace>,
        error: String,
        cx: &mut AsyncApp,
    ) {
        let title = title.into();
        workspace
            .update(cx, move |workspace, cx| {

View on GitHub (pinned to f4178619ac)

Solutions

  1. Delete or move the item currently occupying the original location
  2. Restore to a different location
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/project_panel/src/undo.rs:860 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/4be1e3019c7d4d31. Report an issue: GitHub.