---
title: "Restore a deleted test file from trash"
description: "Verify a soft-deleted asset disappears from the active library, appears in trash, and returns with its original identity after restoration."
canonical_url: "https://vostride.com/agent-library/files-media/trash-and-restore.md"
md_url: "https://vostride.com/agent-library/files-media/trash-and-restore.md"
content_kind: "recipe"
topic: "files-media"
---

# Restore a deleted test file from trash

Verify a soft-deleted asset disappears from the active library, appears in trash, and returns with its original identity after restoration.

## Risk

Soft deletion crosses separate list and detail states. A restore action can recreate a record under a different identifier or restore a name without its preview, so both identity and content need evidence.

## Fixtures

- A test-owned media asset called Recovery sample is prepared with a visible yellow-star image.
- The product supports recoverable trash, and its contract preserves the asset identifier on restoration.
- The seed manifest records the asset key and initial parent folder; no similarly named customer files are in scope.

## Steps

1. Open Recovery sample and verify its yellow-star preview and recorded asset key.
2. Use the application Delete action and confirm only this fixture when the dialog identifies it.
3. Verify the asset is absent from the active parent folder and appears in Trash with its exact name.
4. Restore the trash entry and verify it disappears from Trash and reappears in the original parent folder.
5. Open the restored asset and verify its original key and yellow-star content, then reload to confirm the restoration persisted.

## Expected results

- The delete stage changes active-library membership without permanently destroying the fixture.
- Restoration returns the same asset identity to its initial folder under the stated contract.
- The restored preview renders the prepared image and the trash no longer lists the asset.

## False-pass traps

- Checking only a restored toast misses an entry still stranded in trash.
- A fixture with a duplicate name can cause the wrong file to be restored; compare stable identity wherever available.

## Cleanup

- Delete the restored test asset using the fixture cleanup policy, without emptying unrelated trash.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa first test](/docs/agent-qa/guides/first-test.md)
- [agent-qa web testing](/docs/agent-qa/guides/web-testing.md)

- [Files and media QA recipes](/agent-library/files-media.md)
- [Software factory QA library](/agent-library.md)
