Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

revert a specific old commit

Wicked Worm answered on December 28, 2020 Popularity 10/10 Helpfulness 4/10

Contents


More Related Answers

  • git revert one commit
  • git can we reset a new branch to a specific commit
  • git reset to latest commit
  • git revert latest commit
  • revert to a particular commit git
  • Revert to the previous commit in git
  • revert back to a commit git
  • how to revert the last 2 commits in git
  • how to rollback two previous commits
  • how to revert to a specific commit
  • Rollback a Particular Commit in git command
  • git how to roll back to a commit
  • git reset to a specific commit
  • github restore previous commit
  • revert changes of a previous commit git
  • undo most recent commit
  • how to revert back to one commit
  • git revert to specific commit
  • git go back to specific commit
  • git how to rollback to previous commit
  • How do I revert a Git repository to a previous commit?
  • How do I revert a Git repository to a previous commit?
  • git revert last 2 commits
  • rollback to a previous commit

  • revert a specific old commit

    0
    Popularity 10/10 Helpfulness 4/10 Language shell
    Link to this answer
    Share Copy Link
    Contributed on May 04 2021
    Wicked Worm
    0 Answers  Avg Quality 2/10

    Closely Related Answers



    1
    Popularity 10/10 Helpfulness 4/10 Language shell
    Tags: back
    Link to this answer
    Share Copy Link
    Contributed on Nov 08 2021
    Nutty Newt
    0 Answers  Avg Quality 2/10

    -1
    Popularity 10/10 Helpfulness 4/10 Language shell
    Tags: commit co
    Link to this answer
    Share Copy Link
    Contributed on Dec 28 2020
    thecameroncobb
    0 Answers  Avg Quality 2/10

    0

    I have a simple solution using a patch to revert all your changes.

    1. Checkout current head branch (e.g. develop)

    git checkout develop

    2. Lookup your commit-id in the history log, and check out only your changes into a new branch:

    git log

    git checkout -b your-branch

    3. Look up in your branch, and find the previous status you want to revert to:

    git checkout -b prev-status

    4. Create a patch that can revert all your changes:

    git diff your-branch..prev-status > reverts.patch

    # the comparing order of branches is important

    5. checkout current head branch and apply the reverting patch

    git checkout origin develop

    git apply reverts.patch

    git add *

    git commit -m "revert all my changes" 

    Popularity 8/10 Helpfulness 2/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Mar 13 2023
    Vivek Kakadan
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.