Scenario - using git-flow or similar:
While underway with a stream of work, we become aware that one of the features which has been developed (in a feature-branch and already merged to the develop branch) needs to be urgently hotfixed before the other work in develop will be ready.
What is best practice for achieving this?
In git-flow, hotfixes are typically done using a hotfix branch off master. To follow that model, I'm wondering whether cherry-picking from develop to the hotfix branch is best, or retaining the feature branches after they've been merged to develop and merging those branches to the hotfix branch (or master)? Or something else?
First, I'd like to stress that "the good workflow" does not exists in general, "the good workflow" is the one you feel convenient to work with.
That said, I personnally consider two situations:
If you are owner of your git repo, you may also "rewrite history" by suppressing the merge of the "almost good" feature, and fix the feature to re-merge it later on. This is usually not praised as "changing the history" but if you are just a few developper on the code and everybody is fine with it, that is a possibility.