How to cancel a local git commit

前端 未结 6 2026
抹茶落季
抹茶落季 2021-01-29 17:20

My issue is I have changed a file eg: README, added a new line \'this for my testing line\' and saved the file, then I issued the following commands

 gi         


        
6条回答
  •  面向向阳花
    2021-01-29 17:37

    Use below command:

    $ git reset HEAD~1
    

    After this you also able to view files what revert back like below response.

    Unstaged changes after reset:
    M   application/config/config.php
    M   application/config/database.php
    

提交回复
热议问题