# reinstall_plugin

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/plugins/discovery/reinstall_plugin)

Restore an installed plugin's files from its marketplace source.

Unlike `install_plugin`, this always replaces the cached copy, even when the
registry already lists the same version, so it repairs missing or damaged
files. The enabled state and the plugin's data directory are left as-is.

## Signature

```python
reinstall_plugin(
    plugin_id: str,
) -> PluginInstance
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `plugin_id` | `str` | Yes | Plugin id in `{name}@{marketplace}` form. |

## Returns

`PluginInstance`

Plugin instance loaded from the refreshed cache path.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/6a8d452d70f9bcb978e6bd44831dda093ecbe928/libs/code/deepagents_code/plugins/discovery.py#L329)