I have one bad pushed commit.
How to undo this commit, and back to my working tree (was before)?
This will lead me to right working tree:
git checkout HEAD~1
This will lead me to right commit, but working tree remains the same unnecessary files:
git revert HEAD~1
How to completely rollback to previous commit?
I mean, I shouldn't commit on detached HEAD, right? (in case of git checkout <commit>
)