dcloud git commits restoreRestore a branch's files to an earlier commit, in one new commit
History is kept: the new commit sits on top of the branch and holds exactly the files of `commit`, so files added since are deleted and files deleted since come back. A retry is safe: when the branch already holds those files the answer is 200 with `created: false`, even if `expectedOid` is now stale.
Synopsis
dcloud git commits restore repoId --branch branch --commit commit [flags]Arguments
<repoId>Requiredstring
Also accepted as
--repo-id. Constraints: uuid
Flags
--branchRequiredstring
The branch whose files to restore; it must exist
Constraints: 1-255 chars
--commitRequiredstring
The commit whose files the branch gets: a full commit id (best, a retry then means the same commit), a branch, a tag, or an abbreviated id of at least 7 characters. It must be reachable from a branch or tag of this repository
Constraints: 1-255 chars
--messageOptionalstring
The commit message; `Restore to <short id>: <its subject>` when absent
Constraints: 1-2000 chars
--authorOptionalobject
Record someone else as the author, for a tool committing on behalf of its user; the committer is always the caller. The caller when absent
Constraints: JSON
--expected-oidOptionalstring
Refuse (409) unless the branch is still at this commit, so a restore cannot overwrite a newer save
Constraints: /^[0-9a-f]{40}$/
Example
dcloud git commits restore repoId --branch example --commit exampleGenerated from the API description, the same one the API checks requests against and the CLI is built from.