I use Git to store my changes every day when I finish my job:
git add --all
git commit -m 'some comments'
git push origin master
But today, I need my Git to revert some files to track some bug. So, I decided to go back 3 days ago by using this command:
git checkout 203914
Then, after I found the cause of the bug, I changed back to latest commit by using checkout:
git checkout 981291 << this is my latest commit, about 3 hours ago
Now, after I edit 981291
commit, I want to create a new commit using same way as I do every day:
git add --all
git commit -m 'minor fix'
git push origin master
It says:
HEAD detached from 981291
nothing to commit, working directory clean
Everything up-to-date
Then I checked my BitBucket account, I couldn't find 'minor fix' commit. it seems that after I checkout into previous commit and make some changes, I cannot make new commit into my remote server again.
How can I make a new commit after this checkout?