Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 24cfaf9

Browse files
Update git
1 parent fefc3e6 commit 24cfaf9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,17 @@ git rm <file-name>
238238
git log #check the commit hash and parent id
239239
# revert working tree to commit-hash on parent branch 1
240240
git revert <commit-hash> -m 1
241+
242+
# move commits to another existing branch
243+
git checkout existingbranch
244+
git merge master
245+
git checkout master
246+
git reset --hard HEAD~3 # Go back 3 commits. You *will* lose uncommitted work.
247+
git checkout existingbranch
248+
249+
# move commits to another new branch
250+
git branch newbranch # Create a new branch, saving the desired commits
251+
git reset --hard HEAD~3 # Move master back by 3 commits or put a commit hash
252+
git checkout newbranch # Go to the new branch that still has the desired commits
253+
241254
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /