[24042] 2015-06-30_如何在Git里撤销(几乎)任何操作

文档创建者:s7ckTeam
浏览次数:6
最后更新:2025-01-18
2015-06-30_如何在Git里撤销(几乎)任何操作   G i t   L i n u x   2 0 1 5 - 0 6 - 3 0   ( u n d o )   G i t     G i t     G i t     G i t   :   ,     G i t H u b   c o m m i t     c o m m i t . : :   c o m m i t   S H A     c o m m i t     c o m m i t     c o m m i t         c o m m i t     c o m m i t     c o m m i t     c o m m i t     G i t         c o m m i t     c o m m i t   c o m m i t   :     c o m m i t   g i t   p u s h g i t   r e v e r t   < S H A > g i t   r e v e r t g i t   p u s h   g i t   c o m m i t   - m   " F x i e s   b u g   # 4 2 " g i t   p u s h
  F i x e s   b u g   # 4 2 : :   c o m m i t     c o m m i t     c o m m i t     c o m m i t     c o m m i t   :     c o m m i t         c o m m i t   : :   G i t     S H A   G i t     c h e c k o u t     c h e c k o u t     c o m m i t   G i t   西 :   西   p u s h 西     : : g i t   p u s h g i t   c o m m i t   - - a m e n d g i t   c o m m i t   - - a m e n d   - m   " F i x e s   b u g   # 4 2 " g i t   c o m m i t   - - a m e n d g i t   c h e c k o u t   - -   < b a d   f i l e n a m e > g i t   c h e c k o u t H E A D g i t   d i f f g i t   r e s e t   < l a s t   g o o d   S H A > g i t   r e s e t   - - h a r d   < l a s t   g o o d   S H A > g i t   r e s e t
  S H A         :     c o m m i t : :   西       c o m m i t   西       r e f l o g   c o m m i t   .   c o m m i t   H E A D         r e f l o g   g i t   r e s e t - - h a r d g i t   r e s e t   - - h a r d g i t   r e f l o g g i t   r e s e t g i t   c h e c k o u t g i t   r e f l o g g i t   l o g g i t   r e f l o g H E A D   H E A D g i t   c o m m i t g i t   r e s e t H E A D g i t   c h e c k o u t   - -   < b a d   f i l e n a m e >
G i t         p u s h     c o m m i t   r e f l o g     c o m m i t     c o m m i t   :     c h e c k   o u t   f e a t u r e : , ,   a n d :   g i t   r e f l o g r e f l o g g i t   r e f l o g g i t   r e s e t   - - h a r d   < S H A > g i t   c h e c k o u t   < S H A >   - -   < f i l e n a m e > g i t   c h e r r y - p i c k   < S H A > m a s t e r g i t   b r a n c h   f e a t u r e g i t   r e s e t   - - h a r d   o r i g i n / m a s t e r g i t   c h e c k o u t   f e a t u r e g i t   c h e c k o u t   - b   < n a m e >
      c h e c k   o u t         c o m m i t   c h e c k   o u t     c o m m i t     c o m m i t   :     m a s t e r   : g i t   b r a n c h   f e a t u r e f e a t u r e m a s t e r   g i t   r e s e t   - - h a r d m a s t e r o r i g i n / m a s t e r f e a t u r e g i t   c h e c k o u t f e a t u r e f e a t u r e m a s t e r o r i g i n / m a s t e r m a s t e r o r i g i n / m a s t e r f e a t u r e
:   ( ,   )     c h e c k   o u t     r e s e t     c h e c k   o u t     c h e c k   o u t     c o m m i t     c o m m i t   / :   : :   r e b a s e g i t   c h e c k o u t   f e a t u r e g i t   r e b a s e   m a s t e r g i t   r e s e t - - h a r d g i t   c h e c k o u t   - b   < n e w   b r a n c h   n a m e > g i t   r e b a s e   m a s t e r m a s t e r m a s t e r m a s t e r g i t   r e b a s e   - i   < e a r l i e r   S H A > - i r e b a s e r e b a s e   - i
  S H A     c o m m i t   c o m m i t     c o m m i t 1 3 4   c o m m i t     c o m m i t   使   ( )   c o m m i t       S H A   西   c o m m i t     c o m m i t   使 r e b a s e   - i p i c k r e w o r d p i c k r e w o r d r r e b a s e   - i 0 8 3 5 f e 2 r e b a s e   - i s q u a s h f i x u p
      c o m m i t     c o m m i t     c o m m i t G i t     c o m m i t     c o m m i t     c o m m i t     c o m m i t     .     c o m m i t   c o m m i t     c o m m i t   退 G i t     c o m m i t   c o m m i t   s q u a s h f i x u p 0 8 3 5 f e 2 6 9 4 3 e 8 5 3 8 f 5 e 4 e a f 6 7 f 8 2 s q u a s h f i x u p a f 6 7 f 8 2 3 8 f 5 e 4 e 0 8 3 5 f e 2 6 9 4 3 e 8 5 a f 6 7 f 8 2 0 8 3 5 f e 2
  c o m m i t :     c o m m i t     c o m m i t     p u s h c o m m i t   . : :   c o m m i t     c o m m i t     (   c o m m i t     c o m m i t )   c o m m i t     c o m m i t   使   c o m m i t     c o m m i t     c o m m i t   0 8 3 5 f e 2 c o m m i t   - - a m e n d g i t   c o m m i t   - - s q u a s h   < S H A   o f   t h e   e a r l i e r   c o m m i t > g i t   r e b a s e   - - a u t o s q u a s h   - i   < e v e n   e a r l i e r   S H A > g i t   c o m m i t   - - s q u a s h s q u a s h !   E a r l i e r   c o m m i t c o m m i t   - - s q u a s h g i t   c o m m i t   - - f i x u p c o m m i t   - - f i x u p r e b a s e r e b a s e   - - a u t o s q u a s h   - i r e b a s e s q u a s h !
  c o m m i t     c o m m i t   使   c o m m i t     S H A       1     5     c o m m i t   G i t     c o m m i t   4         5     c o m m i t :   G i t   i n   s q u a s h ! f i x u p ! - - s q u a s h - - f i x u p ^ ~   H E A D ^ H E A D   H E A D ~ 4 H E A D a p p l i c a t i o n . l o g a p p l i c a t i o n . l o g * . l o g . g i t i g n o r e
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则