Skip to content

Instantly share code, notes, and snippets.

@seeker
Created June 13, 2023 08:37
Show Gist options
  • Save seeker/ca0776146bac9e8db5af24928fadd566 to your computer and use it in GitHub Desktop.
Save seeker/ca0776146bac9e8db5af24928fadd566 to your computer and use it in GitHub Desktop.
Move uncommitted changes to another device
# Use the below at your own risk, as you may lose changes with incorrect resets (or it will require digging in the reflog to recover commits).
# WIP_feature-branch contains a single commit with uncommited changes
# WIP branch needs to be exactly one commit ahead of the fetaure branch
git checkout feature-branch
git reset --hard origin/WIP_feature-branch
git reset --soft origin/feature-branch
git reset HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment