我在Windows中使用TortoiseGit作为我的git项目。
我在我的项目上做了一个本地提交。我想撤消它。
如何使用TortoiseGit撤消git commit?不丢弃我的更改
答案 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;
}
和
[注意] 如果您想继续更改树,请改用Reset
。
结果:
Mixed
和
(你可能会遇到冲突,但如何解决冲突是另一回事。:P)
和
结果:
答案 1 :(得分:5)
TortoiseGit -> Show Log -> Revert change by this commit
这将生成一个恢复提交的提交,因此您不会失去&#34;输掉&#34;你的改变。