Here is the story
- I got branch named
ftsfrom remote repoorigin/fts - I've done some commits to local repo
fts(without pushing) - I find I commited something I cannot make public
- I checkout to last safe commit and get You are in 'detached HEAD' state. message
- I've done new commit.
The logs look like that (without some commits)
$ git log --pretty=oneline --abbrev-commit --decorate --all --graph -10 * 3e39eeb (HEAD) That should be pushed as origin/fts | * f38e892 (fts) That cannot be pushed |/ * 84fa79a (origin/fts) Commit i got from remote What should I do to
- Not push commits from current local
fts(f38e892) to remote. - Save this unfortunate branch with different name like
private-fts - Move the branchname
ftsto current detached HEAD (3e39eeb) without any rebasing or merging that would incorporate commits from currentfts. - Push current detached HEAD as
fts(to becomeorigin/fts). - When I'm sure
private-ftsis not needed, get rid of it from local repo either.