Git: remove earlier commit but keep recent changes

前端 未结 8 1501
甜味超标
甜味超标 2020-12-03 10:50

I got some commits in my repository:

like:

A - Added Feature A
B - Removed Feature B
C - Redesigned Feature C
D - Added Feature D
E - Added Feature          


        
8条回答
  •  情歌与酒
    2020-12-03 11:28

    Use git revert

    By far the best solution is to use git revert. This will make a new commit that undoes the changes in a specific SHA. This is a very safe way to remove a commit, and can be easily merge with other or remote branches.

    How to use Git Revert

    git revert 
    

提交回复
热议问题