Home > Software design >  Push changes to remote repo without including latest local commit
Push changes to remote repo without including latest local commit

Time:04-16

My local git repo is 1 commit ahead of my remote one. I don't wanna push the latest local commit but I wanna make a small change on the remote repo. What can I do in this case?

CodePudding user response:

I removed last commit without deleting changes. Using:

$ git reset --soft HEAD~1

Stashed the changes.

Made the small change I wanted and pushed.

Then I popped the stash and commited again.

  • Related