0

たとえば、私はこの歴史を持っています:

commit 1a7cab6c279f5528871cd0ab8dae55319ff81fc0
Author: unknown <poru@.(none)>
Date:   Thu Mar 10 20:11:39 2011 +0800

    Changes to login style, will based the admin on this. version-1

commit 22d308ba085a5d04eadf54fd06f3534e876386de
Author: David Ang <davidang09@gmail.comm>
Date:   Tue Mar 8 23:40:59 2011 +0800

    fixed config settings to run in production mode and removed special
    characters thats disrupting heroku

commit 410b383e105fac39bd70095b186367fa943b1ad8
Author: David Ang <davidang09@gmail.comm>
Date:   Fri Mar 4 01:29:45 2011 +0800

     show pretty time ago
     provide icons
     hide mass delete
     removed special character

commit 789922463ad946c945893c9a8787e589f780fda1
Author: unknown <poru@.(none)>
Date:   Thu Mar 3 18:34:09 2011 +0800

     Tempory style for Login. Will replace this once done with the admin
     styles.

最新のコミットで新しいデザインが進行中ですが、元のデザインであるコミット 78992246 に戻りたいと思いました。

以前は次のようなことをしていました。

git checkout 78992246

次に、これらをマスターの頭にマージすることを望んでいました。

残念ながら、私はどこにも行きません

4

2 に答える 2

2

これを行うためのいくつかの手順があります。

# Create a branch pointing to the original design and checkout to that branch.
git checkout -b original_design 78992246

# Work on it and commit your works on this branch.
git commit ...

# Once you're done, checkout your master branch.
git checkout master

# If you want to, pull from origin to update your master branch.
git pull

# Merge your original_design branch back to master.
git merge original_design
于 2011-03-11T08:35:38.033 に答える
1

適切なコミットに切り替えたら、マージを試みる前にブランチを作成する必要があります。

git checkout -b newdesign 

またはワンステップで

git checkout -b newdesign 78992246

そうしないと、ヘッド分離モードになります。

于 2011-03-11T08:19:11.753 に答える