使用TortoiseGit撤消git提交

时间:2014-04-25 10:03:30

标签: git commit tortoisegit

我在Windows中使用TortoiseGit作为我的git项目。

我在我的项目上做了一个本地提交。我想撤消它。

如何使用TortoiseGit撤消git commit?不丢弃我的更改

2 个答案:

答案 0 :(得分:6)

撤消上次提交:#include <iostream> #include <string> using namespace std; int main() { string name, author, double isbn, float price, int quantity, float firstresult, float secondresult, const float tax (0.07); cout << "What is the name of the book?"; cin >> name; cout << "What is the authors name?"; cin >> author; cout << "What is the ISBN number?"; cin >> isbn; cout << "What is the price?"; cin >> price; cout << "How many books did you purchase?"; cin >> quantity; firstresult = price*tax; secondresult = price + firstresult; if (quantity > 5) { secondresult += (quantity - 5) * 2.00; } cout << "------------------------" << endl; cout << "Invoice of Order:" << endl; cout << name << endl; cout << author << endl; cout << isbn << endl; cout << price << endl; cout << quantity << endl; cout << "Total Cost: " << secondresult << endl; cout << "------------------------" << endl; return 0; }

enter image description here

enter image description here

[注意] 如果您想继续更改树,请改用Reset

结果:

enter image description here

撤消/删除不是最后一个的提交:Mixed

enter image description here

enter image description here

(你可能会遇到冲突,但如何解决冲突是另一回事。:P)

enter image description here

结果:

enter image description here

答案 1 :(得分:5)

TortoiseGit -> Show Log -> Revert change by this commit

这将生成一个恢复提交的提交,因此您不会失去&#34;输掉&#34;你的改变。