The undelete command restores a file that has been temporally deleted from or moved to the recycle bin.
Parameter | Description | Value |
---|---|---|
filename |
Specifies the name of a file to be restored. |
The value is a string of 1 to 160 case-insensitive characters without spaces in the format [ drive ] [ path ] filename. If the string is enclosed in double quotation marks (" "), the string can contain spaces. If the value is a file name, the value is a string of 1 to 64 characters. In the preceding parameter, drive specifies the storage device name, and path specifies the directory and subdirectory. You are advised to add : and / between the storage device name and directory. The directory name cannot contain the following characters: ~ * / \ : ' " |
devicename |
Specifies the storage device name. |
- |
Usage Scenario
You can run the undelete command to restore a file that has been temporally deleted and moved to the recycle bin. However, files that are permanently deleted by running the delete or reset recycle-bin command with the /unreserved parameter cannot be restored.
The following describes the drive name.
If devices are stacked, drive can be named as:
For example, slot2#flash: indicates the flash memory in slot 2.
Like devicename, drive specifies the storage device name.
Precautions
To display information about a temporally deleted file, run the dir /all command. The file name is displayed in square brackets ([ ]).
If the name of a file is the same as an existing directory, the file cannot be restored. If the destination file has the same name as an existing file, the system prompts you whether to overwrite the existing file. The system prompt is displayed only when file prompt is set to alert.
# Restore file sample.bak from the recycle bin.
<HUAWEI> undelete sample.bak Undelete flash:/sample.bak ?[Y/N]:y %Undeleted file flash:/sample.bak.
# Restore a file that has been moved from the root directory to the recycle bin.
<HUAWEI> undelete flash: Undelete flash:/test.txt?[Y/N]:y %Undeleted file flash:/test.txt. Undelete flash:/rr.bak?[Y/N]:y %Undeleted file flash:/rr.bak.