Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Undo, Redo, Change History with Git
Search
Joshua Wehner
January 28, 2015
Programming
0
130
Undo, Redo, Change History with Git
Undo, Redo and Change History with Git
Joshua Wehner
January 28, 2015
Tweet
Share
More Decks by Joshua Wehner
See All by Joshua Wehner
How to Undo Almost* Anything in Git
jaw6
0
100
Must It Always Be About Sex?
jaw6
2
190
Other Decks in Programming
See All in Programming
これならできる!個人開発のすゝめ
tinykitten
PRO
0
120
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
350
Claude Codeの「Compacting Conversation」を体感50%減! CLAUDE.md + 8 Skills で挑むコンテキスト管理術
kmurahama
1
450
AIエージェントの設計で注意するべきポイント6選
har1101
5
970
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
130
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
440
dotfiles 式年遷宮 令和最新版
masawada
1
790
Deno Tunnel を使ってみた話
kamekyame
0
150
Pythonではじめるオープンデータ分析〜書籍の紹介と書籍で紹介しきれなかった事例の紹介〜
welliving
1
200
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
140
脳の「省エネモード」をデバッグする ~System 1(直感)と System 2(論理)の切り替え~
panda728
PRO
0
100
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
500
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
0
190
Rebuilding a faster, lazier Slack
samanthasiow
85
9.3k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
We Are The Robots
honzajavorek
0
110
Transcript
Undo, Redo Change History with Git
Joshua Wehner • @jaw6 •
[email protected]
• Minneapolis, MN, USA
• GitHub Training
Undo & Redo Scenarios
Undo "Public" Change • It's broken • But it's pushed
• git revert <sha>
Tweak Last Commit • Oooops • Committed too fast •
git commit --amend
Regrets, I've Had a Few • Ooooops • That's mostly
rubbish • git reset <last good sha>
Throw It All Away • It's all rubbish • I
regret everything • git reset --hard <last good sha>
Wait, On Second Thought • Throw It All Away •
Could I maybe get that back? • git reflog git reset --hard <sha>
Well, That Wasn't So Bad • Most of that is
trash • But that one? That one is good. • Gimme. • git cherry-pick <good one>
Put That Thing Over There • I should have made
this branch earlier • Those commits should not be on master • git rebase master
None
None
Well, Then Again • Throw It All Some of It
Away • I regret that one thing • Some of the rest of it was okay • git rebase -i <public sha>
I Was Wrong Before • I thought I was wrong
• But I wasn't • git commit --fixup <sha> git rebase -i --autosquash
Forget I Said That • Stop tracking this file •
I mean it • git rm --cached .gitignore git clean -f (also -x maybe?)
Thank you! Undo, Redo, Change History • @jaw6 •
[email protected]
• http://training.github.com/
I'm Only (Sort of) Kidding • Commit part (just part)
of a file • git add -p