Lets say I do a git checkout -b my_new_branch. Making some changes to my local files and after this I add all files with git add. and commit it and push. After this i realize that my branch is messed up and I want to delete it.
So Im going back to my master with git checkout master and delete the branch with git branch -D my_new_branch.
Will all local changes be reversed?
Once you checkout the master branch, all of the changes that you made on
my_new_branchwill no longer be in your working directory. They will still be on your branch and on the server.Once you delete
my_new_branch, the ref to that branch will be deleted. The commits will still exist in your local repository until a garbage collection is run. The commits and branch will also still exist on the remote server.