Jam*_* Gu 21 git commit revert
它是这样的:
我有我修改过的文件A和B.
我只想提交并推送A,但意外地同时提交并推送A和B.
我做了一个"git push old-id:master"所以在github上它显示"Master现在是old-id",其中old-id是我之前的最后一次提交,所以我认为它是在我犯下之前回来的.
题:
注意:我确实需要在本地保留A和B的更改.最终结果应该是:
Amb*_*ber 37
$ git reset <old-id> # Undo the commit after old-id
$ git add A # stage A for a new commit
$ git commit # make the new commit
$ git push # push it
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16033 次 |
| 最近记录: |