dcloud git commits restore

Restore a branch's files to an earlier commit, in one new commit

IAM git:PushRepositoryChanges stateAsks before it deletes (-y skips)

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>Required

    string

    Also accepted as --repo-id. Constraints: uuid

Flags

  • --branchRequired

    string

    The branch whose files to restore; it must exist

    Constraints: 1-255 chars

  • --commitRequired

    string

    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

  • --messageOptional

    string

    The commit message; `Restore to <short id>: <its subject>` when absent

    Constraints: 1-2000 chars

  • --authorOptional

    object

    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-oidOptional

    string

    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 example

Generated from the API description, the same one the API checks requests against and the CLI is built from.