亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Guides gitattributes giteveryday gitglossary gitignore gitmodules gitrevisions gittutorial gitworkflows Administration git archive git bundle git clean git filter-branch git fsck git gc git instaweb git reflog Basic Snapshotting git add git commit git diff git mv git reset git rm git status Branching and Merging git branch git checkout git log git merge git mergetool git stash git tag Debugging git bisect git blame git grep Email git am git format-patch git request-pull git send-email External Systems git fast-import git svn Getting and Creating Projects git clone git init Git git annotate git archimport git bisect-lk2009 git check-attr git check-mailmap git check-ref-format git checkout-index git cherry git citool git column git credential git credential-cache git credential-store git cvsexportcommit git cvsimport git cvsserver git diff-files git diff-tree git difftool git fast-export git fetch-pack git fmt-merge-msg git get-tar-commit-id git gui git http-backend git http-fetch git http-push git imap-send git index-pack git interpret-trailers git ls-remote git ls-tree git mailinfo git mailsplit git merge-file git merge-index git merge-one-file git merge-tree git mktag git mktree git name-rev git notes git p4 git pack-objects git pack-redundant git pack-refs git parse-remote git patch-id git prune git prune-packed git quiltimport git receive-pack git remote-ext git remote-fd git remote-testgit git repack git replace git rerere git send-pack git sh-i18n git sh-setup git shell git show-branch git show-index git stripspace git unpack-file git unpack-objects git upload-archive git upload-pack git var git verify-commit git verify-tag git whatchanged git worktree Inspection and Comparison git describe git shortlog git show Miscellaneous api credentials api index gitcli gitcore tutorial gitcredentials gitcvs migration gitdiffcore githooks gitk gitnamespaces gitremote helpers gitrepository layout gitsubmodules gittutorial 2 gitweb gitweb.conf pack format User Manual Patching git apply git cherry-pick git rebase git revert Plumbing Commands git cat-file git check-ignore git commit-tree git count-objects git diff-index git for-each-ref git hash-object git ls-files git merge-base git read-tree git rev-list git rev-parse git show-ref git symbolic-ref git update-index git update-ref git verify-pack git write-tree Server Admin git daemon git update-server-info Setup and Config git git config git help Sharing and Updating Projects git fetch git pull git push git remote git submodule
characters

命名

git-revert  - 恢復(fù)一些現(xiàn)有的提交

概要

git revert [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<keyid>]] <commit>…
git revert --continuegit revert --quit
git revert --abort

描述

給定一個(gè)或多個(gè)現(xiàn)有的提交,恢復(fù)相關(guān)修補(bǔ)程序引入的更改,并記錄一些記錄它們的新提交。這要求你的工作樹(shù)是干凈的(不需要修改 HEAD 提交)。

注意:git revert用于記錄一些新的提交以反轉(zhuǎn)一些早期提交的影響(通常只是錯(cuò)誤的提交)。如果你想扔掉工作目錄中所有未提交的更改,你應(yīng)該看到 git-reset [1],特別是--hard選項(xiàng)。如果你想提取特定文件,就像在另一個(gè)提交中那樣,你應(yīng)該看到 git-checkout [1],特別是git checkout <commit> -- <filename>語(yǔ)法。請(qǐng)謹(jǐn)慎使用這些替代方法,因?yàn)樗鼈兌紩?huì)丟棄工作目錄中的未提交更改。

選項(xiàng)

<commit>…

承諾恢復(fù)。有關(guān)拼寫(xiě)提交名稱(chēng)的更完整列表,請(qǐng)參閱 gitrevisions [7]。提交集也可以給出,但默認(rèn)情況下不進(jìn)行遍歷,參見(jiàn) git-rev-list [1] 及其--no-walk選項(xiàng)。

-e   --edit

使用此選項(xiàng),git revert將允許您在提交還原之前編輯提交消息。如果您從終端運(yùn)行命令,這是默認(rèn)值。

-m parent-number   --mainline parent-number

通常您無(wú)法恢復(fù)合并,因?yàn)槟恢篮喜⒌哪囊环綉?yīng)被視為主線。此選項(xiàng)指定主線路的父代號(hào)碼(從1開(kāi)始),并允許還原以相對(duì)于指定的父代的相反更改。

恢復(fù)合并提交聲明您將永遠(yuǎn)不希望合并引入的樹(shù)更改。因此,稍后的合并只會(huì)引入不是先前還原合并的祖先的提交引入的樹(shù)更改。這可能是也可能不是你想要的。

有關(guān)更多詳細(xì)信息,請(qǐng)參閱恢復(fù)錯(cuò)誤合并的方法。

--no-edit

使用此選項(xiàng),git revert將不會(huì)啟動(dòng)提交消息編輯器。

-n   --no-commit

通常,該命令會(huì)自動(dòng)創(chuàng)建一些提交日志消息,提交哪些提交已恢復(fù)。此標(biāo)志應(yīng)用必要的更改以將命名的提交恢復(fù)到您的工作樹(shù)和索引,但不進(jìn)行提交。此外,使用此選項(xiàng)時(shí),您的索引不必與 HEAD 提交匹配?;貜?fù)是針對(duì)索引的開(kāi)始狀態(tài)完成的。

將多個(gè)提交的效果還原為連續(xù)的索引時(shí),這非常有用。

-S<keyid>   --gpg-sign=<keyid>

GPG 標(biāo)志提交。該keyid參數(shù)是可選的,并且默認(rèn)為提交者身份; 如果指定,它必須粘貼到選項(xiàng)沒(méi)有空格。

-s   --signoff

在提交消息的末尾添加 Signed-off-by 行。有關(guān)更多信息,請(qǐng)參閱 git-commit [1] 中的 signoff 選項(xiàng)。

--strategy=<strategy>

使用給定的合并策略。只能使用一次。有關(guān)詳細(xì)信息,請(qǐng)參閱 git-merge [1] 中的 MERGE STRATEGIES 部分。

-X<option>   --strategy-option=<option>

將合并策略特定選項(xiàng)傳遞給合并策略。有關(guān)詳細(xì)信息,請(qǐng)參閱 git-merge [1]。

Sequencer子命令

--continue

使用中的信息繼續(xù)正在進(jìn)行的操作.git/sequencer。可以在解決失敗的 cherry-pick 或恢復(fù)中的沖突后繼續(xù)使用。

--quit

忘記當(dāng)前正在進(jìn)行的操作。在 cherry-pick 或恢復(fù)失敗后可用于清除音序器狀態(tài)。

--abort

取消操作并返回到預(yù)序列狀態(tài)。

例子

git revert HEAD~3

恢復(fù) HEAD 中最后第四次提交指定的更改,并使用恢復(fù)的更改創(chuàng)建一個(gè)新的提交。

git revert -n master~5..master~2

將提交完成的更改從 master(包含)中的第五次提交恢復(fù)為 master(包含)中的第三次提交,但不要使用已還原的更改創(chuàng)建任何提交?;謴?fù)只修改工作樹(shù)和索引。

Previous article: Next article: