问题
I have the following recent commits when I do "git log --oneline"...I want to reset to "8ec2027",I tried some rebase commands that didnot work..what is the exact command to do this?
2503013 code: cs release 1.2.3.47
269ed14 code: Fixed below issues due to which 2nd client is not associating to GO
dca02a3 code: Donot allow the scan during WPS/EAPOL exchange.
b2fee57 code: MCC Adaptive Scheduler
6af29c4 code: Not able to connect more then 10 STA
150aacd code: Fix the Max Tx power value in 5G band and .ini support for 11h
8ec2027 Merge "code: cs release 1.2.3.46"
9015b60 Merge "code: Quarky Support on Prima"
......
回答1:
You want to reset not rebase. Rebasing is the act of replaying commits. Resetting is making the current commit some other one.
you will need to save any work that you may have in your work directory first:
git stash -u
then you will make you current commit the one you want with
git reset --hard 8ec2027
Optionally, after you can save where you were before doing this with:
git branch -b temp HEAD@{1}
see reflog documentation to see how this works.
回答2:
Probably this could also work out for you
Create a new branch at 2503013 (this saves the changes after 8ec202)
git reset --hard 8ec2027
来源:https://stackoverflow.com/questions/14314596/how-to-reset-to-a-specific-commit