I've made a git commit that I haven't pushed yet, but I would like to remove the commit, but keep the changes to my file. How do I do that?
            Asked
            
        
        
            Active
            
        
            Viewed 108 times
        
    1 Answers
2
            like this
git reset --soft HEAD~1
git reset .
 
    
    
        eftshift0
        
- 26,375
- 3
- 36
- 60
- 
                    
- 
                    
- 
                    
- 
                    
- 
                    Well, I just wanted to change the commit message, so I guess I got lucky – Serket Aug 21 '20 at 20:18
- 
                    1If you wanted to modify the commit message you do it like this: `git commit --amend -m "new message"`. No need to move anywhere. – eftshift0 Aug 21 '20 at 20:18
