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"
......
Make sure you are on the branch where the commit is. I'm doing this on master. Then use git reset –hard <commit-hash> to set the current branch HEAD to the commit you want.
You can revert a specific commit to remove its changes from your branch. When you revert to a previous commit, the revert is also a commit. The original commit also remains in the repository's history.
To hard reset files to HEAD on Git, use the “git reset” command with the “–hard” option and specify the HEAD. The purpose of the “git reset” command is to move the current HEAD to the commit specified (in this case, the HEAD itself, one commit before HEAD and so on).
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.
Probably this could also work out for you
Create a new branch at 2503013 (this saves the changes after 8ec202)
git reset --hard 8ec2027
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With