How do I revert back to earlier commit using source tree

前端 未结 2 1626
有刺的猬
有刺的猬 2020-12-25 14:34

I have a project stored on my Mac and created a repository for from that location to my project. I am able to commit using source tree but now I would like to revert back t

2条回答
  •  臣服心动
    2020-12-25 15:11

    I think in above discussion @dominones and @Giraldi maybe misunderstand each other,

    @Giraldi maybe want to delete those unwanted commits permanently in the GIT, and make the git go back to a certain history commit, from there he could start all over again, like you want to be fresh from the beginning of somewhere.

    while @dmonones is showing just how to revert back to a status of your code in a history, discarding some code changes you did, which will mostly end up with a new commit aiming to remove a unwanted/mistaken change, without changing the git history.

    To discard an already committed commit in git history, you need to use hard reset and push with force.

提交回复
热议问题