Git Step By Step - Step 2: Go Back in Time

来源:互联网 发布:联通关闭2g网络 编辑:程序博客网 时间:2024/04/30 21:42

Scenario 1: discarding unstaged changes

You are working on a certain branch, and after your last commitment, you have made some changes which you haven't staged yet, now, you want do abandon those changes.


Scenario 2: go back to a prior commitment

You need to know the hash code of the commitment you want to go back to, you can get it by running log command:



Or you can make your query more specific:



Now you know how to identify one certain commitment, then you can run reset command to go back to a previous commitment:






0 0
原创粉丝点击