Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7181075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:28:51+00:00 2026-05-28T17:28:51+00:00

I messed up… How do I undo a pushed commit so that it’s like

  • 0

I messed up…

How do I undo a pushed commit so that it’s like it never happened?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:28:52+00:00Added an answer on May 28, 2026 at 5:28 pm

    Warning: every step here is destructive. Don’t get it wrong, and take a copy of your repo before you start.

    git reset --hard $what, where what is the SHA or whatever you want to go back to on that branch. (eg: HEAD^ if you just want to discard the latest commit.)

    Once you have done that, git push --force ... to get that to the remote repository.

    That solves everything … except removing the dead blob, etc, from the remote repository. If that matters to you, life is harder. There isn’t any protocol way to get rid of it, so you either delete the remote repo and create a new, clean copy, or do something back-end specific.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've never messed with Master Pages, and I'd like to migrate some of my
I'd like to differentiate between errors that happen because something is messed up in
We've got a situation where someone messed up a Commit to our SVN server.
Non-english characters are messed up in a text column. Arabic text looks like this:
I've noticed that my pageview counts are being messed up by the pipe-lining feature
while working i messed HTML because i did not knew that <p> tag within
Looks like I have messed up with Java Threads/OS Threads and Interpreted language. Before
I've messed up my WiX-based installer on multiple servers so that it no longer
I messed some config files up and need to get so that my git
I'm a bit messed up with the following: I have a function that calls

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.