Skip to content

MyTalkzHub

Menu
  • Home
  • Coding Articles
  • Marketing
  • Celebrity
  • How To
Menu
How do I delete unpushed git commits?

How do I delete unpushed git commits?

Posted on December 15, 2022

To delete unpushed git commits, you can use the git reset command. Here’s an example of how to use git reset to delete the last unpushed commit:

  1. First, use git log to view the list of commits in your repository.
$ git log
  1. Then, use the git reset command with the --hard option to delete the last unpushed commit.
$ git reset --hard HEAD~1
  1. Finally, push the changes to your remote repository using the git push command.
$ git push -f

Note: The -f option is used to force the push, which is necessary when you are deleting commits that have already been pushed to the remote repository.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How to Review Your Sales Funnel
  • How to Sell a Sales Funnel
  • How to Test a Sales Funnel
  • How to Track Your Sales Funnel
  • How to Use the Sales Funnel

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022

Categories

  • Celebrity
  • Coding Articles
  • How To
  • Marketing
©2023 MyTalkzHub | Design: Newspaperly WordPress Theme