当前位置:网站首页>How does idea withdraw code from remote push
How does idea withdraw code from remote push
2022-07-04 09:14:00 【The fruit of it midsummer】
In normal development , We often commit some wrong code to the remote branch by hand , At this time, we want to withdraw quickly to avoid unnecessary problems caused by the error code being pulled by colleagues , Today we will demonstrate :
First of all, this is the code in my remote warehouse :
My local code :
operation : Hand error twice in a row ( First submission and second submission ) Submit the local error code to the remote warehouse
git Submit the record :(nio It's actually my first time to submit information. I mistakenly wrote it here , But it doesn't affect )
Local code records :
Remote warehouse records :
At this time, mistakes have been made , I have submitted the wrong code to the remote branch twice by hand , So how can I withdraw ?
At this time, find the submission you want to withdraw to , Right click to select (Reset Current Branch to Here). such as : I want the code to roll back to what it looked like when I first submitted , Just find my first submission nio Right click to select Reset Current Branch to Here Click to select the second one Mixed Click ok
At this time, you will find that your local code is still the same as before , But it shows no commit The state of .
Find your local change record at this time ( Is our usual code commit The box that pops out when )
Click on this. " Arrow returned " Roll back
Click on Rollback after , Our code will return to the way we first submitted .
But at this time, it is only local restore , The previously submitted error code is still on the remote . So we need to cover the code to the remote .
Because the previous operations are first update>>>>>push, But in our case , Will pull down the remote error code , Then our previous operations are in vain , So it needs to be enforced push. Although we didn't submit information at this time , But we can still choose to force push.
Be careful : At this time, I found idea mandatory push Button gray , So I changed it to command line coercion push.
git push origin HEAD --force
Finally, it is found that the remote code has been successfully overwritten
边栏推荐
- MySQL foundation 02 - installing MySQL in non docker version
- Analysis report on the development status and investment planning of China's modular power supply industry Ⓠ 2022 ~ 2028
- Function comparison between cs5261 and ag9310 demoboard test board | cost advantage of cs5261 replacing ange ag9310
- Investment analysis and future production and marketing demand forecast report of China's paper industry Ⓥ 2022 ~ 2028
- Some points needing attention in PMP learning
- Educational Codeforces Round 119 (Rated for Div. 2)
- ArrayBuffer
- Live in a dream, only do things you don't say
- What is permission? What is a role? What are users?
- How to write unit test cases
猜你喜欢
ArcGIS application (XXII) ArcMap loading lidar Las format data
After unplugging the network cable, does the original TCP connection still exist?
C language - Introduction - Foundation - syntax - data type (4)
【LeetCode 42】501. Mode in binary search tree
Opencv environment construction (I)
At the age of 30, I changed to Hongmeng with a high salary because I did these three things
C language - Introduction - Foundation - syntax - [main function, header file] (II)
[C Advanced] file operation (2)
随机事件的关系与运算
Awk from entry to earth (12) awk can also write scripts to replace the shell
随机推荐
How to pass custom object via intent in kotlin
awk从入门到入土(5)简单条件匹配
HMS core helps baby bus show high-quality children's digital content to global developers
2022-2028 global elastic strain sensor industry research and trend analysis report
Trees and graphs (traversal)
Opencv environment construction (I)
awk从入门到入土(11)awk getline函数详解
C language - Introduction - Foundation - syntax - [main function, header file] (II)
【LeetCode 42】501. Mode in binary search tree
awk从入门到入土(6)正则匹配
awk从入门到入土(7)条件语句
Nurse level JDEC addition, deletion, modification and inspection exercise
Simulate EF dbcontext with MOQ - mocking EF dbcontext with MOQ
Function comparison between cs5261 and ag9310 demoboard test board | cost advantage of cs5261 replacing ange ag9310
How to ensure the uniqueness of ID in distributed environment
C语言-入门-基础-语法-[主函数,头文件](二)
Global and Chinese markets of water heaters in Saudi Arabia 2022-2028: Research Report on technology, participants, trends, market size and share
Les différents modèles imbriqués de listview et Pageview avec les conseils de flutter
Codeforces Round #793 (Div. 2)(A-D)
[error record] no matching function for call to 'cacheflush' cacheflush();)