I am not sure if I am using Git incorrectly, but I have a main branch. I wanted to test a new feature so I created a side branch. I ran
git branch new-feature
git checkout new-feature
Then, I modified my code in the new-feature
branch. I realized this new feature wasn't very good, so I decided to switch back to my main branch and delete the new-feature
branch.
I ran a git checkout main
. However, my code did not update back to what it was before. Additionally, all the modules I modified now has an M
beside them. I am wondering how I can restore my main branch.
Specifically, when I checkout the main branch, I get:
Switched to branch 'main'
M Module1.txt
M Module2.txt...