Level 1
git checkout -b temp
git checkout master
git merge temp
git branch -d temp
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm in master.
I went to history git checkout 845454514231. And I made a lot of changes to the code.
When I now do git commit I will get error you are currently not on a branch. Understandably.
How do I force commit these changes? I don't mind losing any past/future code. My current code is only thing that matters.
git checkout -b temp
git checkout master
git merge temp
git branch -d temp
Please or to participate in this conversation.