V
V
VicTHOR2020-03-06 11:17:25
git
VicTHOR, 2020-03-06 11:17:25

How to roll back changes not by commit, but by HEAD?

git reflog

a86a84 [email protected]{0}: checkout: moving from testsite to 6a86a84
6a86a84 [email protected]{1}: reset: moving to [email protected]{2}
8ca67a5 [email protected]{2}: checkout: moving from sale-exchange to testsite
dab4777 [email protected]{3}: commit: [feat] add new fields to sale.export xml
6a86a84 [email protected]{4}: checkout: moving from 6a86a84d390f613a51c996b1d856b02d6a852372 to sale-exchange
6a86a84 [email protected]{5}: checkout: moving from testsite to 6a86a84

I do git reset --hard [email protected]{4}
HEAD is now at 6a86a84 [merge] Merge cf048f0 from 'origin/master' into testsite

Why didn't it switch to that checkout state?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Avaj, 2020-03-06
@sandroisu

Switched to the same place where you wrote, no?
You write git reset --hard [email protected]{4}
They write to you HEAD is now at 6a86a84
Look where you wrote - here:
6a86a84 [email protected]{4}: checkout: moving from 6a86a84d390f613a51c996b1d856b02d6a852372 to sale-exchange Which one
should have been switched to?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question