I have branch X - working on a task.
Suddenly I run into a bug, and I fix it on branch Y and open a pull request.
I would like to continue work on branch X, with the changes made on branch Y but without the commit.
Is there a way to do this in git?
You could cherry-pick the commit on branch Y to branch X, and tell it not to make a commit.
git cherry-pick <hash> --no-commit