A revert option, like 'checkout' to undo just a single commit

Issue #455 wontfix
Shivashis Padhi created an issue

Now, the checkout options undos all the changes made after the target commit.

A revert option should ideally only undos that commit, and create a new commit with the change.

Comments (1)

  1. Shivashis Padhi reporter

    git revert fails for changes on a single file. To reproduce

    mkdir temp
    touch one.txt
    # make first change
    git add one.txt
    git commit one.txt -m "one"
    # make change second
    git commit one.txt -m "two"
    # make change third
    git commit one.txt -m "three"
    # git log, see hash of second commit say $H
    git revert $H 
    # gives merge conflict
    

    it works, when the head change is on a different file.

  2. Log in to comment