mc undo
Themc undo command reverses changes due to either aPUT orDELETE operation at a specified path.
The following command reverts the last three uploads and/or deletions of thefile.zip object on themyaistor deployment in thedata bucket:
mc undo myaistor/data/file.zip --last3The command has the following syntax:
mc[GLOBALFLAGS] undo\ TARGET\[--action"type"]\[--force]\[--last"integer"]\[-- recursive*Alias:* -r]\[--dry-run]- Brackets
[]indicate optional parameters. - Parameters sharing a line are mutually dependent.
- Parameters separated using the pipe
|operator are mutually exclusive.
Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.
Required
The full path to the object or prefix where the command should run.The path must include theALIAS, bucket, and prefix or object name.
Optional
Undo the most recent change of the specified type.Accepted values areDELETE orPUT.
By default,mc undo reverses bothDELETE andPUT operations.Use--action to choose one or the other, but only for the most recent operation of the specified type.
The following command reverts the most recentPUT for the objecttoday.zip in bucketdata, reverting to the previous object version:
mc undo myaistor/data/today.zip --action"PUT"This example reverts the most recentDELETE for the prefixarchive, recursively restoring it and any child objects:
mc undo myaistor/data/archive --recursive --action"DELETE"Mutually exclusive with--last.
Optional
Output the results of the command without actually performing the operations.Use this flag to test the outcome of running the command in a particular way.
Optional
Force a recursive operation.
Optional
Accepts an integer value specifying the number ofPUT and/orDELETE changes to undo.
If not specified, the command reverses one (1) operation.
Mutually exclusive with--action.
Alias: -r
Optional
Performs the command in a recursive fashion.Use this flag to undo changes on a prefix, for example.
This command supports any of theglobal flags.
The following command reverts the last three uploads and/or deletions of thefile.zip object on themyaistor deployment in thedata bucket:
mc undo myaistor/data/file.zip --last3Usemc undo to reverse the most recentPUT orDELETE operation performed on themyaistor alias in thedata bucket under thepresentations/recordings/ prefix:
mc undo myaistor/data/presentations/recordings/ --recursive --forceThemc command-line tool is built for compatibility with the AWS S3 API and is tested with AIStor and AWS S3 for expected functionality and behavior.
MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported.
Whilemc commandsmay work as documented, any such usage is at your own risk.