My code is based on a cherry-pick I have done to another patch. I pushed it by mistake as the other patch is not ready yet. So in gerrit I see the other patch files as well. How do I make now my pushed patch re-based without the other files that came in from the other patch?
Linked Questions
- Git Clone Fails with inflate: data stream error (invalid distance code)
- git identify the most recent intersection of two branches
- How do I deal with an error in my .gitmodules history?
- fatal: No HEAD commit to compare with (yet)
- What is HEAD in Git?
- error: Cannot fetch linaro-swg/arm-trusted-firmware.git
- git-filter-branch: leave directory structure
- git-filter-branch: leave directory structure unchanged
- Is git's semi-secret empty tree object reliable, and why is there not a symbolic name for it?
- git - Add some subdirectories to the local repo but not to remote?
- Move a sequential set of commits from one (local) branch to another
- Maintaining project with plugins in git
- What’s the most idiomatic way to implement a “floating tag” in Git?
- Move commits from one branch to another and then merge them back in
- Why can't I view branches remotely
Popular Questions
- Partially applied generic function "cannot be cast to Nothing"
- Peek and Pop not an option
- Run JIRA in port 80 as root
- Agar.io style ripple effect for canvas arcs
- What is the difference between [ValidateModel] and a check of valid state in ASP.NET?
- Passing shared_ptr to std::function (member function)
- UWP location tracking even when the app was suspended
- Docker – fix service IP addresses
- Dynamic partition in hive
- How to enable Indications on Client Configuration descriptor from iOS8
Related Questions
- What is the meaning of git push message
- Git strategy to keep on applying my changes to someone else's updeting branch
- Git and client/server code separation
- When (if ever) will HEAD~ and HEAD^ not be the same commit?
- Mixing private and public repository in Git workflow
- git claims to have merged a change into my local repository, but really it hasn't. What am I doing wrong?
- git push one branch back to original remote branch
- Specify branch for a git submodule?
- How should I save one single file updated log when I move one file to another git repo?
- Changing the branch on which another branch is based after changes have already been shared
- Correct way of updating a git repository without readding the directories
- How git works when two peers push changes to same remote simultaneously
- git-mv showing file deleted
- How do I restore files to previous states in git?
- Git: how to see work that was done on a branch which is now merged
To restore the branch to where it was before the cherry-pick, do this (where
n
is the number of cherry-picked commits):Note that a force-push might mess up the commit history for anyone who has pulled your branch after your cherry-pick.
If you want to cherry-pick parts of a commit (just the one file), it can for instance be done this way: